Re: [PATCH] x86/mrst: add SFI platform device parsing code

From: Alan Cox
Date: Mon Sep 20 2010 - 11:13:48 EST


> > +static void *lis331dl_platform_data(void *info)
> > +{
> > + static short intr2nd_pdata;
> > + struct i2c_board_info *i2c_info = (struct i2c_board_info
> > *)info;
>
> It's rather concerning that the parser here needs to have all this
> knowledge about the specific chips that will be on the boards. Is
> there a plan for how this will be managed once system integrators
> begin putting other chips onto Moorestown boards?

It depends on the device. The information for the platform device has
to come from somewhere and the kernel has no formal standard structure
for private data passed from platform devices - so in a lot of cases
its really just the needed glue so the platform device code in
drivers/i2c etc stays independent.

For a device that doesn't need any private structure passing it's just
a case of knowing the Linux name that matches the firmware description.
For a chip that already has a Linux driver that expects private data
(or a new driver that needs to) the info has to come from somewhere and
Linux packages it in per device fashion.

The parser has the knowledge precisely because we don't want to put the
knowledge in the driver.

Alan

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/