Thread (10 messages) flat view 10 messages, 4 authors, 2005-06-13

Re: MPC52xx: sysfs failure on adding new device driver

From: Grant Likely <hidden>
Date: 2005-06-10 16:06:34

On 6/10/05, Sylvain Munaut [off-list ref] wrote:
Hi Grant
=20
quoted
+     /* Assign driver names to PSC devices */
+     ppc_sys_platform_devices[MPC52xx_PSC1].name =3D "mpc52xx-psc.uart=
";
quoted
+     ppc_sys_platform_devices[MPC52xx_PSC2].name =3D "mpc52xx-psc.uart=
";
quoted
+     ppc_sys_platform_devices[MPC52xx_PSC3].name =3D "mpc52xx-psc.spi"=
;
=20
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.
=20
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
=20
ppc_sys_assign_subfn(MPC52xx_PSC1,"uart");
=20
=20
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 =3D "mpc52xx-psc.uart";

g.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help