On 6/10/05, Sylvain Munaut <tnt at 246tnt.com> wrote: > Hi Grant > > > + /* Assign driver names to PSC devices */ > > + ppc_sys_platform_devices[MPC52xx_PSC1].name = "mpc52xx-psc.uart"; > > + ppc_sys_platform_devices[MPC52xx_PSC2].name = "mpc52xx-psc.uart"; > > + ppc_sys_platform_devices[MPC52xx_PSC3].name = "mpc52xx-psc.spi"; > > Yes, I kinda like that. That maybe the cleanest way, just 1 line of code > per device and when no subfn is assigned, nothing is loaded. > > I don't really like messing manually with the ppc_sys_platform > "internals" outside of the ppc_sys code, but maybe creating a call like > > ppc_sys_assign_subfn(MPC52xx_PSC1,"uart"); > > > and place it in the ppc_sys code so that other platforms havin such > "multi usage" device all have an uniform way of handling that. Galak ? Hmm, yes... I like this better. I was also uncomfortable with messing with the table directly. A function like that can make sure that the table is not modified after it is registered with the platform bus; or if it is, make sure that a driver has not yet been assigned and that sysfs is properly updated. It would protect against doing something stupid like:
ppc_sys_platform_devices[MPC52xx_MSCAN1].name = "mpc52xx-psc.uart"; g.