All of lore.kernel.org
 help / color / mirror / Atom feed
* [lm-sensors] some remarks over platform_device use in f71805f.c
@ 2006-02-04  9:44 Hans de Goede
  2006-02-04 10:19 ` Jean Delvare
  2006-03-02 21:52 ` Jean Delvare
  0 siblings, 2 replies; 3+ messages in thread
From: Hans de Goede @ 2006-02-04  9:44 UTC (permalink / raw)
  To: lm-sensors

Hi,

After reading the discussion about the usage of platform_device in 
f71805f.c, I've been busy converting the Abit uGuru driver to a 
platform_driver.

I've taken the f71805f.c file as an example and see some room for 
improvements there:

-f71805f_device_add can effectively be removed by using
  platform_device_register_simple, which does all this in 1 step except
  for filling the resource struct.

-Also you pass in the base address as the id, this will lead to a dir
  name in sysfs of f71805f<baseaddr> where base addr will be decimal.

  Since you clearly plan on supporting only one device for now, you
  should / could pass -1 as id, which will get you a sysfs dir entry of
  just f71805f.

-You've made the resource struct a static global, but it can be
  a normal local variable since the platform_device copy allocs its own
  copy, see the lifetime is not an issue.


Regards,

Hans



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-03-02 21:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-04  9:44 [lm-sensors] some remarks over platform_device use in f71805f.c Hans de Goede
2006-02-04 10:19 ` Jean Delvare
2006-03-02 21:52 ` Jean Delvare

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.