mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] treewide: remove stale instances of struct device
@ 2020-07-21  6:15 Ahmad Fatoum
  2020-08-03 21:21 ` Sascha Hauer
  0 siblings, 1 reply; 4+ messages in thread
From: Ahmad Fatoum @ 2020-07-21  6:15 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

We call it struct device_d, any instances of struct device are likely
left-over code after porting from Linux.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/crypto/caam/intern.h   | 5 -----
 drivers/crypto/caam/jr.h       | 2 --
 drivers/gpio/gpio-sx150x.c     | 1 -
 drivers/usb/musb/musb_gadget.c | 9 ---------
 4 files changed, 17 deletions(-)

diff --git a/drivers/crypto/caam/intern.h b/drivers/crypto/caam/intern.h
index 6dfcea26ac41..b13b7e08bc70 100644
--- a/drivers/crypto/caam/intern.h
+++ b/drivers/crypto/caam/intern.h
@@ -53,8 +53,6 @@ struct caam_drv_private_jr {
  */
 struct caam_drv_private {
 
-	struct device *dev;
-	struct device *smdev;
 	struct device_d **jrpdev; /* Alloc'ed array per sub-device */
 	struct device_d *pdev;
 
@@ -89,9 +87,6 @@ struct caam_drv_private {
 	struct clk *caam_emi_slow;
 };
 
-void caam_jr_algapi_init(struct device *dev);
-void caam_jr_algapi_remove(struct device *dev);
-
 int caam_rng_probe(struct device_d *dev, struct device_d *jrdev);
 int caam_blob_gen_probe(struct device_d *dev, struct device_d *jrdev);
 int caam_jr_probe(struct device_d *dev);
diff --git a/drivers/crypto/caam/jr.h b/drivers/crypto/caam/jr.h
index e0e53c0f6cbf..85aca6d88c24 100644
--- a/drivers/crypto/caam/jr.h
+++ b/drivers/crypto/caam/jr.h
@@ -8,8 +8,6 @@
 #define JR_H
 
 /* Prototypes for backend-level services exposed to APIs */
-struct device *caam_jr_alloc(void);
-void caam_jr_free(struct device *rdev);
 int caam_jr_enqueue(struct device_d *dev, u32 *desc,
 		    void (*cbk)(struct device_d *dev, u32 *desc, u32 status,
 				void *areq),
diff --git a/drivers/gpio/gpio-sx150x.c b/drivers/gpio/gpio-sx150x.c
index 76535187b0b4..cf166f3c28cc 100644
--- a/drivers/gpio/gpio-sx150x.c
+++ b/drivers/gpio/gpio-sx150x.c
@@ -45,7 +45,6 @@ struct sx150x_device_data {
 };
 
 struct sx150x_gpio {
-	struct device *dev;
 	struct i2c_client *client;
 	struct gpio_chip gpio;
 	struct regmap *regmap;
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
index fc5cfb13f5df..87f7e78e66d6 100644
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -653,15 +653,6 @@ void musb_free_request(struct usb_ep *ep, struct usb_request *req)
 	kfree(to_musb_request(req));
 }
 
-static LIST_HEAD(buffers);
-
-struct free_record {
-	struct list_head	list;
-	struct device		*dev;
-	unsigned		bytes;
-	dma_addr_t		dma;
-};
-
 /*
  * Context: controller locked, IRQs blocked.
  */
-- 
2.27.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] treewide: remove stale instances of struct device
  2020-07-21  6:15 [PATCH] treewide: remove stale instances of struct device Ahmad Fatoum
@ 2020-08-03 21:21 ` Sascha Hauer
  2020-08-04  5:02   ` Masahiro Yamada
  0 siblings, 1 reply; 4+ messages in thread
From: Sascha Hauer @ 2020-08-03 21:21 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

On Tue, Jul 21, 2020 at 08:15:23AM +0200, Ahmad Fatoum wrote:
> We call it struct device_d, any instances of struct device are likely
> left-over code after porting from Linux.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>  drivers/crypto/caam/intern.h   | 5 -----
>  drivers/crypto/caam/jr.h       | 2 --
>  drivers/gpio/gpio-sx150x.c     | 1 -
>  drivers/usb/musb/musb_gadget.c | 9 ---------
>  4 files changed, 17 deletions(-)

Applied, thanks

Sascha


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] treewide: remove stale instances of struct device
  2020-08-03 21:21 ` Sascha Hauer
@ 2020-08-04  5:02   ` Masahiro Yamada
  2020-08-10 19:30     ` Sascha Hauer
  0 siblings, 1 reply; 4+ messages in thread
From: Masahiro Yamada @ 2020-08-04  5:02 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: Barebox List, Ahmad Fatoum

On Tue, Aug 4, 2020 at 6:22 AM Sascha Hauer <s.hauer@pengutronix.de> wrote:
>
> On Tue, Jul 21, 2020 at 08:15:23AM +0200, Ahmad Fatoum wrote:
> > We call it struct device_d, any instances of struct device are likely
> > left-over code after porting from Linux.
> >
> > Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> > ---
> >  drivers/crypto/caam/intern.h   | 5 -----
> >  drivers/crypto/caam/jr.h       | 2 --
> >  drivers/gpio/gpio-sx150x.c     | 1 -
> >  drivers/usb/musb/musb_gadget.c | 9 ---------
> >  4 files changed, 17 deletions(-)
>
> Applied, thanks
>
> Sascha


Why doesn't barebox use (struct device)?

(Of course its implementation is much simpler
than that of Linux).




-- 
Best Regards
Masahiro Yamada

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] treewide: remove stale instances of struct device
  2020-08-04  5:02   ` Masahiro Yamada
@ 2020-08-10 19:30     ` Sascha Hauer
  0 siblings, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2020-08-10 19:30 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: Barebox List, Ahmad Fatoum

On Tue, Aug 04, 2020 at 02:02:16PM +0900, Masahiro Yamada wrote:
> On Tue, Aug 4, 2020 at 6:22 AM Sascha Hauer <s.hauer@pengutronix.de> wrote:
> >
> > On Tue, Jul 21, 2020 at 08:15:23AM +0200, Ahmad Fatoum wrote:
> > > We call it struct device_d, any instances of struct device are likely
> > > left-over code after porting from Linux.
> > >
> > > Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> > > ---
> > >  drivers/crypto/caam/intern.h   | 5 -----
> > >  drivers/crypto/caam/jr.h       | 2 --
> > >  drivers/gpio/gpio-sx150x.c     | 1 -
> > >  drivers/usb/musb/musb_gadget.c | 9 ---------
> > >  4 files changed, 17 deletions(-)
> >
> > Applied, thanks
> >
> > Sascha
> 
> 
> Why doesn't barebox use (struct device)?

For historical reasons. When creating barebox I thought that it's better
to not use the same struct name when they are not exactly compatible. We
have struct driver_d for the same reason.

I am not sure I would do the same again. If we find good reasons to name
them struct device and struct driver we can change that.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-08-10 19:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-21  6:15 [PATCH] treewide: remove stale instances of struct device Ahmad Fatoum
2020-08-03 21:21 ` Sascha Hauer
2020-08-04  5:02   ` Masahiro Yamada
2020-08-10 19:30     ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox