Re: [PATCH 1/5] power: RFC: introduce a new power API



On Sun, 2007-12-16 at 21:24 -0500, Andres Salomon wrote:
This API has the power_supply drivers device their own device_attribute
list; I find this to be a lot more flexible and cleaner. For example,
rather than having a function with a huge switch statement (as olpc_battery
currently has), we have separate callback functions. We're not limited
to drivers only being able to pass 'int' and 'char*'s in sysfs, we're
not forced to keep a global string around in memory (as is again the
case for olpc_battery's serial number code), we don't have ordering
restrictions w/ the return value being interpreted based upon where it's
located in the array... etc. The other API seems to encourage driver
authors to get their custom sysfs knobs into the list of sysfs knobs, and
this one doesn't.

If there is interest in this API, I'll convert the rest of the power_supply
drivers over to it and resubmit patches.

Looks sane enough to me. If Anton has no objections, I'll merge it.

Ignore the psy->num_properties indentation below; that was done so patch #4
wasn't stupidly large.

Interesting... but I suppose it makes sense.

--
dwmw2

--
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/



Relevant Pages

  • Re: [PATCH 1/5] power: RFC: introduce a new power API
    ... As for olpc's "huge switch statement", ... to be a hex string; ... Yes, API is encouraging to add knobs, but not just any knobs. ... and I don't see any power_supply drivers ...
    (Linux-Kernel)
  • Re: [RFC] killing the NR_IRQS arrays.
    ... Subject: IRQ API ... interrupt controllers, and knowing hardware designers, they'll ... I believe that there are some common problems with the existing API ... architecture specific drivers now if they feel they would benefit ...
    (Linux-Kernel)
  • Re: Linux in a binary world... a doomsday scenario
    ... If binary drivers were a nice idea, it would be so, but unfortunately they ... DOS didn't have an API for non-FAT filesystems. ... >> Do a stable API save us work? ...
    (Linux-Kernel)
  • Re: Linux drivers management
    ... Linux source. ... If you split up drivers and the core kernel into two sepperate ... API change needs to be made. ...
    (Linux-Kernel)
  • Re: [PATCH] Remove "obsolete" label from ISDN4Linux (v3)
    ... If not well the pain factor will resolve the problem. ... It has drivers using functions that will soon be deleted. ... None of the past kernel API changes were done by someone ... to push through a kernel API change that would break it. ...
    (Linux-Kernel)