* [PATCH 00/19] driver:usb&net: add missing platform_driver owner
@ 2013-05-21 2:42 Libo Chen
2013-05-21 6:26 ` David Miller
2013-05-21 18:40 ` Greg KH
0 siblings, 2 replies; 11+ messages in thread
From: Libo Chen @ 2013-05-21 2:42 UTC (permalink / raw)
To: linux-arm-kernel
I find a lot of mistakes using struct platform_driver without owner.
So I pick up some of them including usb and net modules
Libo Chen (19):
drivers/usb/musb: add missing platform_driver owner
drivers/usb/host: add missing platform_driver owner
drivers/usb/chipidea: add missing platform_driver owner
drivers/usb/dwc3: add missing platform_driver owner
drivers/ust/renesas_usbhs: add missing platform_driver owner
drivers/usb/phy: add missing platform_driver owner
drivers/usb/gadget: add missing platform_driver owner
drivers/net/ethernet/amd: add missing platform_driver owner
drivers/net/ethernet: add missing platform_driver owner
drivers/net/ethernet/freescale: add missing platform_driver owner
drivers/net/ethernet/natsemi: add missing platform_driver owner
drivers/net/ethernet/xscale: add missing platform_driver owner
drivers/net/ethernet/calxeda: add missing platform_driver owner
drivers/net/wireless/brcm80211/brcmfmac: add missing platform_driver
owner
drivers/net/irda: add missing platform_driver owner
drivers/net/wan: add missing platform_driver owner
drivers/net/ethernet/nxp: add missing platform_driver owner
drivers/net/ethernet/marvell: add missing platform_driver owne
drivers/net/ethernet/renesas: add missing platform_driver owner
drivers/net/ethernet/amd/am79c961a.c | 1 +
drivers/net/ethernet/calxeda/xgmac.c | 1 +
drivers/net/ethernet/dnet.c | 3 ++-
drivers/net/ethernet/freescale/xgmac_mdio.c | 1 +
drivers/net/ethernet/korina.c | 1 +
drivers/net/ethernet/marvell/mvneta.c | 1 +
drivers/net/ethernet/natsemi/xtsonic.c | 1 +
drivers/net/ethernet/nxp/lpc_eth.c | 1 +
drivers/net/ethernet/renesas/sh_eth.c | 1 +
drivers/net/ethernet/xscale/ixp4xx_eth.c | 1 +
drivers/net/irda/bfin_sir.c | 1 +
drivers/net/irda/sh_irda.c | 1 +
drivers/net/irda/sh_sir.c | 1 +
drivers/net/irda/smsc-ircc2.c | 1 +
drivers/net/wan/ixp4xx_hss.c | 1 +
drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 3 ++-
drivers/usb/chipidea/ci13xxx_msm.c | 2 +-
drivers/usb/chipidea/core.c | 1 +
drivers/usb/dwc3/core.c | 1 +
drivers/usb/dwc3/dwc3-exynos.c | 1 +
drivers/usb/dwc3/dwc3-omap.c | 1 +
drivers/usb/gadget/r8a66597-udc.c | 1 +
drivers/usb/host/ehci-atmel.c | 1 +
drivers/usb/host/ehci-msm.c | 1 +
drivers/usb/host/ehci-mv.c | 1 +
drivers/usb/host/ehci-mxc.c | 1 +
drivers/usb/host/ehci-omap.c | 1 +
drivers/usb/host/ehci-spear.c | 1 +
drivers/usb/host/isp1760-if.c | 1 +
drivers/usb/host/oxu210hp-hcd.c | 1 +
drivers/usb/host/xhci-plat.c | 1 +
drivers/usb/musb/am35x.c | 1 +
drivers/usb/musb/blackfin.c | 1 +
drivers/usb/musb/da8xx.c | 1 +
drivers/usb/musb/davinci.c | 1 +
drivers/usb/musb/omap2430.c | 1 +
drivers/usb/musb/tusb6010.c | 1 +
drivers/usb/musb/ux500.c | 1 +
drivers/usb/phy/phy-rcar-usb.c | 1 +
drivers/usb/renesas_usbhs/common.c | 1 +
40 files changed, 42 insertions(+), 3 deletions(-)
--
1.8.1.2
^ permalink raw reply [flat|nested] 11+ messages in thread* [PATCH 00/19] driver:usb&net: add missing platform_driver owner 2013-05-21 2:42 [PATCH 00/19] driver:usb&net: add missing platform_driver owner Libo Chen @ 2013-05-21 6:26 ` David Miller 2013-05-21 6:41 ` Thomas Petazzoni 2013-05-21 18:40 ` Greg KH 1 sibling, 1 reply; 11+ messages in thread From: David Miller @ 2013-05-21 6:26 UTC (permalink / raw) To: linux-arm-kernel From: Libo Chen <libo.chen@huawei.com> Date: Tue, 21 May 2013 10:42:00 +0800 > I find a lot of mistakes using struct platform_driver without owner. > So I pick up some of them including usb and net modules Instead of doing it this way, which is obviously error prone and easy to forget, make platform_driver_register() be a macro which sets the module owner field then calls the real __platform_driver_register(). ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 00/19] driver:usb&net: add missing platform_driver owner 2013-05-21 6:26 ` David Miller @ 2013-05-21 6:41 ` Thomas Petazzoni 2013-05-21 7:13 ` David Miller 2013-05-21 8:00 ` Gu Zheng 0 siblings, 2 replies; 11+ messages in thread From: Thomas Petazzoni @ 2013-05-21 6:41 UTC (permalink / raw) To: linux-arm-kernel Dear David Miller, On Mon, 20 May 2013 23:26:19 -0700 (PDT), David Miller wrote: > From: Libo Chen <libo.chen@huawei.com> > Date: Tue, 21 May 2013 10:42:00 +0800 > > > I find a lot of mistakes using struct platform_driver without owner. > > So I pick up some of them including usb and net modules > > Instead of doing it this way, which is obviously error prone and > easy to forget, make platform_driver_register() be a macro which > sets the module owner field then calls the real > __platform_driver_register(). Or, maybe make the existing module_platform_driver() macro do this? Best regards, Thomas -- Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 00/19] driver:usb&net: add missing platform_driver owner 2013-05-21 6:41 ` Thomas Petazzoni @ 2013-05-21 7:13 ` David Miller 2013-05-21 8:00 ` Gu Zheng 1 sibling, 0 replies; 11+ messages in thread From: David Miller @ 2013-05-21 7:13 UTC (permalink / raw) To: linux-arm-kernel From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Date: Tue, 21 May 2013 08:41:08 +0200 > Dear David Miller, > > On Mon, 20 May 2013 23:26:19 -0700 (PDT), David Miller wrote: >> From: Libo Chen <libo.chen@huawei.com> >> Date: Tue, 21 May 2013 10:42:00 +0800 >> >> > I find a lot of mistakes using struct platform_driver without owner. >> > So I pick up some of them including usb and net modules >> >> Instead of doing it this way, which is obviously error prone and >> easy to forget, make platform_driver_register() be a macro which >> sets the module owner field then calls the real >> __platform_driver_register(). > > Or, maybe make the existing module_platform_driver() macro do this? Even better. ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 00/19] driver:usb&net: add missing platform_driver owner 2013-05-21 6:41 ` Thomas Petazzoni 2013-05-21 7:13 ` David Miller @ 2013-05-21 8:00 ` Gu Zheng 2013-05-21 8:26 ` Libo Chen 2013-05-21 9:06 ` Thomas Petazzoni 1 sibling, 2 replies; 11+ messages in thread From: Gu Zheng @ 2013-05-21 8:00 UTC (permalink / raw) To: linux-arm-kernel On 05/21/2013 02:41 PM, Thomas Petazzoni wrote: > Dear David Miller, > > On Mon, 20 May 2013 23:26:19 -0700 (PDT), David Miller wrote: >> From: Libo Chen <libo.chen@huawei.com> >> Date: Tue, 21 May 2013 10:42:00 +0800 >> >>> I find a lot of mistakes using struct platform_driver without owner. >>> So I pick up some of them including usb and net modules >> >> Instead of doing it this way, which is obviously error prone and >> easy to forget, make platform_driver_register() be a macro which >> sets the module owner field then calls the real >> __platform_driver_register(). > > Or, maybe make the existing module_platform_driver() macro do this? But not all the modules use module_platform_driver() macro to replace the module init/exit. Thanks, Gu > > Best regards, > > Thomas ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 00/19] driver:usb&net: add missing platform_driver owner 2013-05-21 8:00 ` Gu Zheng @ 2013-05-21 8:26 ` Libo Chen 2013-05-21 8:50 ` Gu Zheng 2013-05-21 9:06 ` Thomas Petazzoni 1 sibling, 1 reply; 11+ messages in thread From: Libo Chen @ 2013-05-21 8:26 UTC (permalink / raw) To: linux-arm-kernel On 2013/5/21 16:00, Gu Zheng wrote: > On 05/21/2013 02:41 PM, Thomas Petazzoni wrote: > >> Dear David Miller, >> >> On Mon, 20 May 2013 23:26:19 -0700 (PDT), David Miller wrote: >>> From: Libo Chen <libo.chen@huawei.com> >>> Date: Tue, 21 May 2013 10:42:00 +0800 >>> >>>> I find a lot of mistakes using struct platform_driver without owner. >>>> So I pick up some of them including usb and net modules >>> >>> Instead of doing it this way, which is obviously error prone and >>> easy to forget, make platform_driver_register() be a macro which >>> sets the module owner field then calls the real >>> __platform_driver_register(). >> >> Or, maybe make the existing module_platform_driver() macro do this? > > > But not all the modules use module_platform_driver() macro to replace the module init/exit. > > Thanks, > Gu > yes, there are many drivers register platform_driver by platform_driver_register manually. make both platform_driver_register() and module_platform_driver() to check and set the module owner field? >> >> Best regards, >> >> Thomas > > > > . > ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 00/19] driver:usb&net: add missing platform_driver owner 2013-05-21 8:26 ` Libo Chen @ 2013-05-21 8:50 ` Gu Zheng 0 siblings, 0 replies; 11+ messages in thread From: Gu Zheng @ 2013-05-21 8:50 UTC (permalink / raw) To: linux-arm-kernel On 05/21/2013 04:26 PM, Libo Chen wrote: > On 2013/5/21 16:00, Gu Zheng wrote: >> On 05/21/2013 02:41 PM, Thomas Petazzoni wrote: >> >>> Dear David Miller, >>> >>> On Mon, 20 May 2013 23:26:19 -0700 (PDT), David Miller wrote: >>>> From: Libo Chen <libo.chen@huawei.com> >>>> Date: Tue, 21 May 2013 10:42:00 +0800 >>>> >>>>> I find a lot of mistakes using struct platform_driver without owner. >>>>> So I pick up some of them including usb and net modules >>>> >>>> Instead of doing it this way, which is obviously error prone and >>>> easy to forget, make platform_driver_register() be a macro which >>>> sets the module owner field then calls the real >>>> __platform_driver_register(). >>> >>> Or, maybe make the existing module_platform_driver() macro do this? >> >> >> But not all the modules use module_platform_driver() macro to replace the module init/exit. >> >> Thanks, >> Gu >> > > yes, there are many drivers register platform_driver by platform_driver_register manually. > > make both platform_driver_register() and module_platform_driver() to check and set the module owner field? No, module_platform_driver() will call platform_driver_register() to register platform_driver, just do it in platform_driver_register() is enough. As David mentioned, making platform_driver_register() be a macro and sets the module owner field in it, seems a good way. Thanks, Gu > > > >>> >>> Best regards, >>> >>> Thomas >> >> >> >> . >> > > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo at vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ > ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 00/19] driver:usb&net: add missing platform_driver owner 2013-05-21 8:00 ` Gu Zheng 2013-05-21 8:26 ` Libo Chen @ 2013-05-21 9:06 ` Thomas Petazzoni 2013-05-21 9:42 ` Libo Chen 1 sibling, 1 reply; 11+ messages in thread From: Thomas Petazzoni @ 2013-05-21 9:06 UTC (permalink / raw) To: linux-arm-kernel Dear Gu Zheng, On Tue, 21 May 2013 16:00:19 +0800, Gu Zheng wrote: > > Or, maybe make the existing module_platform_driver() macro do this? > > But not all the modules use module_platform_driver() macro to replace the module init/exit. Then maybe it's a good opportunity to convert those ones to use module_platform_driver() ? Thomas -- Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 00/19] driver:usb&net: add missing platform_driver owner 2013-05-21 9:06 ` Thomas Petazzoni @ 2013-05-21 9:42 ` Libo Chen 2013-05-22 1:30 ` Gu Zheng 0 siblings, 1 reply; 11+ messages in thread From: Libo Chen @ 2013-05-21 9:42 UTC (permalink / raw) To: linux-arm-kernel On 2013/5/21 17:06, Thomas Petazzoni wrote: > Dear Gu Zheng, > > On Tue, 21 May 2013 16:00:19 +0800, Gu Zheng wrote: > >>> Or, maybe make the existing module_platform_driver() macro do this? >> >> But not all the modules use module_platform_driver() macro to replace the module init/exit. > > Then maybe it's a good opportunity to convert those ones to use > module_platform_driver() ? > > Thomas > In my opinion, not all modules can use module_platform_driver() macro to replace the module init/exit easily, like us3mc_init. Furthermore this work will touch various platforms and architectures, I am worried it is hard to *test* (compile and boot). What do you think? ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 00/19] driver:usb&net: add missing platform_driver owner 2013-05-21 9:42 ` Libo Chen @ 2013-05-22 1:30 ` Gu Zheng 0 siblings, 0 replies; 11+ messages in thread From: Gu Zheng @ 2013-05-22 1:30 UTC (permalink / raw) To: linux-arm-kernel On 05/21/2013 05:42 PM, Libo Chen wrote: > On 2013/5/21 17:06, Thomas Petazzoni wrote: >> Dear Gu Zheng, >> >> On Tue, 21 May 2013 16:00:19 +0800, Gu Zheng wrote: >> >>>> Or, maybe make the existing module_platform_driver() macro do this? >>> >>> But not all the modules use module_platform_driver() macro to replace the module init/exit. >> >> Then maybe it's a good opportunity to convert those ones to use >> module_platform_driver() ? >> >> Thomas >> > > In my opinion, not all modules can use module_platform_driver() macro to replace the module init/exit easily, like us3mc_init. > > Furthermore this work will touch various platforms and architectures, I am worried it is hard to *test* (compile and boot). Agree. I stick to the way that David mentioned. Thanks, Gu > > What do you think? > > ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 00/19] driver:usb&net: add missing platform_driver owner 2013-05-21 2:42 [PATCH 00/19] driver:usb&net: add missing platform_driver owner Libo Chen 2013-05-21 6:26 ` David Miller @ 2013-05-21 18:40 ` Greg KH 1 sibling, 0 replies; 11+ messages in thread From: Greg KH @ 2013-05-21 18:40 UTC (permalink / raw) To: linux-arm-kernel On Tue, May 21, 2013 at 10:42:00AM +0800, Libo Chen wrote: > I find a lot of mistakes using struct platform_driver without owner. > So I pick up some of them including usb and net modules Like others said, make the function call a macro that sets the module owner in it, like all of the other major subsystem registration calls do (usb_drivers, pci_drivers, etc.) thanks, greg k-h ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2013-05-22 1:30 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-05-21 2:42 [PATCH 00/19] driver:usb&net: add missing platform_driver owner Libo Chen 2013-05-21 6:26 ` David Miller 2013-05-21 6:41 ` Thomas Petazzoni 2013-05-21 7:13 ` David Miller 2013-05-21 8:00 ` Gu Zheng 2013-05-21 8:26 ` Libo Chen 2013-05-21 8:50 ` Gu Zheng 2013-05-21 9:06 ` Thomas Petazzoni 2013-05-21 9:42 ` Libo Chen 2013-05-22 1:30 ` Gu Zheng 2013-05-21 18:40 ` Greg KH
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).