Messages in this thread | | | Date | Sat, 18 Feb 2012 20:44:48 +0100 | From | Jean Delvare <> | Subject | Re: [PATCH 1/3 v4] mfd: Add LPC driver for Intel ICH chipsets |
| |
Oh, BTW...
On Fri, 17 Feb 2012 17:28:23 -0600 (CST), Aaron Sierra wrote: > This driver currently creates resources for use by a forthcoming ICH > chipset GPIO driver. It could be expanded to created the resources for > converting the esb2rom (mtd) and iTCO_wdt (wdt), and potentially more, > drivers to use the mfd model. > > Signed-off-by: Aaron Sierra <asierra@xes-inc.com> > Signed-off-by: Guenter Roeck <linux@roeck-us.net> > --- > (...) > +static void lpc_ich_finalize_cell(struct mfd_cell *cell, > + const struct pci_device_id *id) > +{ > + cell->id = id->driver_data;
I don't think this makes any sense. By using global variables for per-device resources and states, your driver pretty much assumes that at most one supported device is present on every given system (which is indeed always the case AFAIK.) So you should set id to 0 here...
> + cell->platform_data = &lpc_chipset_info[id->driver_data]; > + cell->pdata_size = sizeof(struct lpc_ich_info); > +} > (...) > + ret = mfd_add_devices(&dev->dev, 0, &lpc_ich_cells[LPC_GPIO], > + 1, NULL, 0);
... and to -1 here, so that the platform devices created don't receive a number at all. Many mfd drivers do exactly this.
-- Jean Delvare
| |