Message ID | 1352909950-32555-2-git-send-email-m.grzeschik@pengutronix.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Michael Grzeschik <m.grzeschik@pengutronix.de> writes: > From: Marc Kleine-Budde <mkl@pengutronix.de> > > Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> > Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> static yes, __devinitdata -- probably not. These structs are used everywhere throughout the driver currently, not only at initialization time. > --- > drivers/usb/chipidea/ci13xxx_pci.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/usb/chipidea/ci13xxx_pci.c b/drivers/usb/chipidea/ci13xxx_pci.c > index 918e149..97d25c8 100644 > --- a/drivers/usb/chipidea/ci13xxx_pci.c > +++ b/drivers/usb/chipidea/ci13xxx_pci.c > @@ -23,17 +23,17 @@ > /****************************************************************************** > * PCI block > *****************************************************************************/ > -struct ci13xxx_platform_data pci_platdata = { > +static struct ci13xxx_platform_data pci_platdata __devinitdata = { > .name = UDC_DRIVER_NAME, > .capoffset = DEF_CAPOFFSET, > }; > > -struct ci13xxx_platform_data langwell_pci_platdata = { > +static struct ci13xxx_platform_data langwell_pci_platdata __devinitdata = { > .name = UDC_DRIVER_NAME, > .capoffset = 0, > }; > > -struct ci13xxx_platform_data penwell_pci_platdata = { > +static struct ci13xxx_platform_data penwell_pci_platdata __devinitdata = { > .name = UDC_DRIVER_NAME, > .capoffset = 0, > .power_budget = 200, > -- > 1.7.10.4
On 11/16/2012 11:06 AM, Alexander Shishkin wrote: > Michael Grzeschik <m.grzeschik@pengutronix.de> writes: > >> From: Marc Kleine-Budde <mkl@pengutronix.de> >> >> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> >> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> > > static yes, __devinitdata -- probably not. These structs are used > everywhere throughout the driver currently, not only at initialization > time. Yes, but a copy of the platform_data is used: The PCI driver calls ci13xxx_add_device(): http://lxr.free-electrons.com/source/drivers/usb/chipidea/ci13xxx_pci.c#L85 which calls platform_device_add_data(): http://lxr.free-electrons.com/source/drivers/usb/chipidea/core.c#L364 which makes a copy of the platform_data: http://lxr.free-electrons.com/source/drivers/base/platform.c#L246 Marc
Marc Kleine-Budde <mkl@pengutronix.de> writes: > On 11/16/2012 11:06 AM, Alexander Shishkin wrote: >> Michael Grzeschik <m.grzeschik@pengutronix.de> writes: >> >>> From: Marc Kleine-Budde <mkl@pengutronix.de> >>> >>> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> >>> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> >> >> static yes, __devinitdata -- probably not. These structs are used >> everywhere throughout the driver currently, not only at initialization >> time. > > Yes, but a copy of the platform_data is used: True, forgot about that. Apologies. Regards, -- Alex
On Fri, Nov 16, 2012 at 12:06:57PM +0200, Alexander Shishkin wrote: > Michael Grzeschik <m.grzeschik@pengutronix.de> writes: > > > From: Marc Kleine-Budde <mkl@pengutronix.de> > > > > Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> > > Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> > > static yes, __devinitdata -- probably not. These structs are used > everywhere throughout the driver currently, not only at initialization > time. __devinitdata means nothing anymore given that CONFIG_HOTPLUG is always enabled. It also will probably be removed for 3.8, so don't even worry about adding these types of markings to variables. thanks, greg k-h
diff --git a/drivers/usb/chipidea/ci13xxx_pci.c b/drivers/usb/chipidea/ci13xxx_pci.c index 918e149..97d25c8 100644 --- a/drivers/usb/chipidea/ci13xxx_pci.c +++ b/drivers/usb/chipidea/ci13xxx_pci.c @@ -23,17 +23,17 @@ /****************************************************************************** * PCI block *****************************************************************************/ -struct ci13xxx_platform_data pci_platdata = { +static struct ci13xxx_platform_data pci_platdata __devinitdata = { .name = UDC_DRIVER_NAME, .capoffset = DEF_CAPOFFSET, }; -struct ci13xxx_platform_data langwell_pci_platdata = { +static struct ci13xxx_platform_data langwell_pci_platdata __devinitdata = { .name = UDC_DRIVER_NAME, .capoffset = 0, }; -struct ci13xxx_platform_data penwell_pci_platdata = { +static struct ci13xxx_platform_data penwell_pci_platdata __devinitdata = { .name = UDC_DRIVER_NAME, .capoffset = 0, .power_budget = 200,