Message ID | c076984af7e65c433fdfd3a3b0f8d20da2c18013.1407931005.git.michal.simek@xilinx.com |
---|---|
State | Superseded |
Headers | show |
On Wed, Aug 13, 2014 at 01:56:51PM +0200, Michal Simek wrote: > There is no need to init .owner field. > > Based on the patch from Peter Griffin <peter.griffin@linaro.org> > "mmc: remove .owner field for drivers using module_platform_driver" > > This patch removes the superflous .owner field for drivers which It says drivers, but does only one... > use the module_platform_driver API, as this is overriden in > platform_driver_register anyway." ... so: any interest in doing this for the whole subsystem? Basically good catch, though. > > Signed-off-by: Michal Simek <michal.simek@xilinx.com> > --- > > drivers/i2c/busses/i2c-cadence.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/drivers/i2c/busses/i2c-cadence.c b/drivers/i2c/busses/i2c-cadence.c > index 63f3f03ecc9b..04d0a7e449ef 100644 > --- a/drivers/i2c/busses/i2c-cadence.c > +++ b/drivers/i2c/busses/i2c-cadence.c > @@ -890,7 +890,6 @@ MODULE_DEVICE_TABLE(of, cdns_i2c_of_match); > static struct platform_driver cdns_i2c_drv = { > .driver = { > .name = DRIVER_NAME, > - .owner = THIS_MODULE, > .of_match_table = cdns_i2c_of_match, > .pm = &cdns_i2c_dev_pm_ops, > }, > -- > 1.8.2.3 >
On 09/20/2014 11:11 AM, Wolfram Sang wrote: > On Wed, Aug 13, 2014 at 01:56:51PM +0200, Michal Simek wrote: >> There is no need to init .owner field. >> >> Based on the patch from Peter Griffin <peter.griffin@linaro.org> >> "mmc: remove .owner field for drivers using module_platform_driver" ^ this shouldn't be there. >> >> This patch removes the superflous .owner field for drivers which > > It says drivers, but does only one... I have c&p this from Peter's description that's why there are just drivers. > >> use the module_platform_driver API, as this is overriden in >> platform_driver_register anyway." > > ... so: any interest in doing this for the whole subsystem? Basically > good catch, though. Mark was also interested about doing this for spi. Doing this for the whole kernel will be the best. coccinelle script is good option I have never played with it. Thanks, Michal
> oing this for the whole kernel will be the best. coccinelle script > is good option I have never played with it. Thanks, but superseded in favour of a generic solution (https://lkml.org/lkml/2014/10/21/594).
diff --git a/drivers/i2c/busses/i2c-cadence.c b/drivers/i2c/busses/i2c-cadence.c index 63f3f03ecc9b..04d0a7e449ef 100644 --- a/drivers/i2c/busses/i2c-cadence.c +++ b/drivers/i2c/busses/i2c-cadence.c @@ -890,7 +890,6 @@ MODULE_DEVICE_TABLE(of, cdns_i2c_of_match); static struct platform_driver cdns_i2c_drv = { .driver = { .name = DRIVER_NAME, - .owner = THIS_MODULE, .of_match_table = cdns_i2c_of_match, .pm = &cdns_i2c_dev_pm_ops, },
There is no need to init .owner field. Based on the patch from Peter Griffin <peter.griffin@linaro.org> "mmc: remove .owner field for drivers using module_platform_driver" This patch removes the superflous .owner field for drivers which use the module_platform_driver API, as this is overriden in platform_driver_register anyway." Signed-off-by: Michal Simek <michal.simek@xilinx.com> --- drivers/i2c/busses/i2c-cadence.c | 1 - 1 file changed, 1 deletion(-) -- 1.8.2.3