rx51-battery.ko incompatiblity: board code vs DT

4 messages, 3 authors, 2015-07-07 · open the first message on its own page

rx51-battery.ko incompatiblity: board code vs DT

From: Pali Rohár <hidden>
Date: 2015-07-06 19:44:29

Hello,

now I found out that rx51-battery.ko driver register sysnode 
/sys/class/power_supply/rx51-battery/ when booting with legacy board 
code. But when booting DT kernel it register sysnode with different name 
/sys/class/power_supply/n900-battery/

Sysfs node for DT kernel comes from Nokia N900 DTS file: 
arch/arm/boot/dts/omap3-n900.dts

I would propose change which change DTS to "rx51-battery" to have it 
compatible with naming which is for legacy board code. It is just 
because to have compatibility and same naming scheme and also to make 
existing programs to work without needing patching them.

What do you think?

-- 
Pali Rohár
pali.rohar@gmail.com

Re: rx51-battery.ko incompatiblity: board code vs DT

From: Pavel Machek <hidden>
Date: 2015-07-07 10:42:01

On Mon 2015-07-06 21:44:22, Pali Rohár wrote:
Hello,

now I found out that rx51-battery.ko driver register sysnode 
/sys/class/power_supply/rx51-battery/ when booting with legacy board 
code. But when booting DT kernel it register sysnode with different name 
/sys/class/power_supply/n900-battery/

Sysfs node for DT kernel comes from Nokia N900 DTS file: 
arch/arm/boot/dts/omap3-n900.dts

I would propose change which change DTS to "rx51-battery" to have it 
compatible with naming which is for legacy board code. It is just 
because to have compatibility and same naming scheme and also to make 
existing programs to work without needing patching them.

What do you think?
Makes sense.. along with _big_ comment in the dts why we are doing
this.
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

Re: rx51-battery.ko incompatiblity: board code vs DT

From: Sebastian Reichel <sre@kernel.org>
Date: 2015-07-07 15:02:43

Hi,

On Mon, Jul 06, 2015 at 09:44:22PM +0200, Pali Rohár wrote:
now I found out that rx51-battery.ko driver register sysnode 
/sys/class/power_supply/rx51-battery/ when booting with legacy board 
code. But when booting DT kernel it register sysnode with different name 
/sys/class/power_supply/n900-battery/

Sysfs node for DT kernel comes from Nokia N900 DTS file: 
arch/arm/boot/dts/omap3-n900.dts

I would propose change which change DTS to "rx51-battery" to have it 
compatible with naming which is for legacy board code. It is just 
because to have compatibility and same naming scheme and also to make 
existing programs to work without needing patching them.

What do you think?
Change the driver instead (in rx51_battery_probe):

-   di->bat.name = dev_name(&pdev->dev);
+   di->bat.name = "rx51-battery"

This will keep the DT ABI stable and avoid introducing the term rx51
in the device tree file.

-- Sebastian

Re: rx51-battery.ko incompatiblity: board code vs DT

From: Pali Rohár <hidden>
Date: 2015-07-07 15:15:57

On Tuesday 07 July 2015 17:02:30 Sebastian Reichel wrote:
Hi,

On Mon, Jul 06, 2015 at 09:44:22PM +0200, Pali Rohár wrote:
quoted
now I found out that rx51-battery.ko driver register sysnode 
/sys/class/power_supply/rx51-battery/ when booting with legacy board 
code. But when booting DT kernel it register sysnode with different name 
/sys/class/power_supply/n900-battery/

Sysfs node for DT kernel comes from Nokia N900 DTS file: 
arch/arm/boot/dts/omap3-n900.dts

I would propose change which change DTS to "rx51-battery" to have it 
compatible with naming which is for legacy board code. It is just 
because to have compatibility and same naming scheme and also to make 
existing programs to work without needing patching them.

What do you think?
Change the driver instead (in rx51_battery_probe):

-   di->bat.name = dev_name(&pdev->dev);
+   di->bat.name = "rx51-battery"

This will keep the DT ABI stable and avoid introducing the term rx51
in the device tree file.

-- Sebastian
Perfect, if it works fine can you send & apply patch?

-- 
Pali Rohár
pali.rohar@gmail.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help