Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1191333 > unrolled thread

Re: [PATCH 5/8] power: bq27x00_battery: Renaming for consistency

Started byBelisko Marek <marek.belisko@gmail.com>
First post2015-07-23 23:40 +0200
Last post2015-07-24 09:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 5/8] power: bq27x00_battery: Renaming for consistency Belisko Marek <marek.belisko@gmail.com> - 2015-07-23 23:40 +0200
    Re: [PATCH 5/8] power: bq27x00_battery: Renaming for consistency Pali Rohár <pali.rohar@gmail.com> - 2015-07-24 09:50 +0200

#1191333 — Re: [PATCH 5/8] power: bq27x00_battery: Renaming for consistency

FromBelisko Marek <marek.belisko@gmail.com>
Date2015-07-23 23:40 +0200
SubjectRe: [PATCH 5/8] power: bq27x00_battery: Renaming for consistency
Message-ID<pPwnF-2cG-31@gated-at.bofh.it>
On Thu, Jul 23, 2015 at 11:15 PM, Pali Rohár <pali.rohar@gmail.com> wrote:
> On Thursday 23 July 2015 22:56:26 Belisko Marek wrote:
>> Hi Pali,
>>
>> On Thu, Jul 23, 2015 at 10:15 PM, Pali Rohár <pali.rohar@gmail.com>
>> wrote:
>> > On Thursday 23 July 2015 19:03:08 Andrew F. Davis wrote:
>> >> >> -#ifdef CONFIG_BATTERY_BQ27X00_I2C
>> >> >> -MODULE_ALIAS("i2c:bq27000-battery");
>> >> >> +#ifdef CONFIG_BATTERY_BQ27XXX_I2C
>> >> >> +MODULE_ALIAS("i2c:bq27xxx-battery");
>> >> >>
>> >> >>  #endif
>> >> >
>> >> > Why is this MODULE_ALIAS needed? Some lines upper there is
>> >> >
>> >> >  MODULE_DEVICE_TABLE(i2c, bq27xxx_id);
>> >> >
>> >> > which add proper i2c: module alias...
>> >>
>> >> Not sure, looks like it was added in commit
>> >> 8ebb7e9c1a502cfc300618c19c3c6f06fc76d237 which claims that the
>> >> "module won't get loaded automatically" without it, but I have not
>> >> had this problem, so I'm not sure why it's there.
>> >
>> > git grep bq27000-battery show me that only one driver uses that
>> > name: drivers/w1/slaves/w1_bq27000.c
>> >
>> > And more over, it is platform device, not i2c device. So that
>> > commit 8ebb7e9c1a502cfc300618c19c3c6f06fc76d237 is wrong! CCing
>> > Marek.
>>
>> If you look to power/bq27x00 driver then there is I2C part and
>> platform part only
>> both selectable by config. In
>> 8ebb7e9c1a502cfc300618c19c3c6f06fc76d237 was added MODULE_ALIAS to
>> have this driver working as module for both buses. Even if I2C isn't
>> used anywhere
>> I add MODULE_ALIAS also for that.
>>
>> > MODULE_ALIAS("platform:bq27000-battery") is really needed for
>> > w1_bq27000.c but MODULE_ALIAS("i2c:bq27000-battery") should be
>> > removed. It is not used by any board platform code or DT.
>>
>> Not sure if it's good idea to remove it. Somebody outside can use it.
>>
>> > Marek, correct me if I'm wrong.
>> >
>> > --
>> > Pali Rohár
>> > pali.rohar@gmail.com
>>
>> BR,
>>
>> marek
>
> Who, where any why is using alias i2c:bq27000-battery??
>
> It is obviously wrong to add that alias. MODULE_DEVICE_TABLE(i2c, ...
> macro automatically adds all MODULE_ALIASes for all i2c devices.
Hmm are you sure? I think it's not true if you look to include/linux/module.h
Those 2 macros have completely other purposes.
>
> If there is such device with needs i2c:bq27000-battery is should be
> fixed to use i2c:bq27??? identifier exported by MODULE_DEVICE_TABLE.
Look if you don't like it remove i2c part from driver and post patch.
But as I said
somebody can use it (not talking about vanilla tree).
>
> git grep on kernel tree did not return anything, so there is no usage.
>
> Of course alias for platform:bq27000-battery is needed.
>
> --
> Pali Rohár
> pali.rohar@gmail.com

BR,

marek



-- 
as simple and primitive as possible
-------------------------------------------------
Marek Belisko - OPEN-NANDRA
Freelance Developer

Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
Tel: +421 915 052 184
skype: marekwhite
twitter: #opennandra
web: http://open-nandra.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1191579

FromPali Rohár <pali.rohar@gmail.com>
Date2015-07-24 09:50 +0200
Message-ID<pPFTY-7Gq-11@gated-at.bofh.it>
In reply to#1191333
On Thursday 23 July 2015 23:36:24 Belisko Marek wrote:
> On Thu, Jul 23, 2015 at 11:15 PM, Pali Rohár <pali.rohar@gmail.com> wrote:
> > On Thursday 23 July 2015 22:56:26 Belisko Marek wrote:
> >> Hi Pali,
> >>
> >> On Thu, Jul 23, 2015 at 10:15 PM, Pali Rohár <pali.rohar@gmail.com>
> >> wrote:
> >> > On Thursday 23 July 2015 19:03:08 Andrew F. Davis wrote:
> >> >> >> -#ifdef CONFIG_BATTERY_BQ27X00_I2C
> >> >> >> -MODULE_ALIAS("i2c:bq27000-battery");
> >> >> >> +#ifdef CONFIG_BATTERY_BQ27XXX_I2C
> >> >> >> +MODULE_ALIAS("i2c:bq27xxx-battery");
> >> >> >>
> >> >> >>  #endif
> >> >> >
> >> >> > Why is this MODULE_ALIAS needed? Some lines upper there is
> >> >> >
> >> >> >  MODULE_DEVICE_TABLE(i2c, bq27xxx_id);
> >> >> >
> >> >> > which add proper i2c: module alias...
> >> >>
> >> >> Not sure, looks like it was added in commit
> >> >> 8ebb7e9c1a502cfc300618c19c3c6f06fc76d237 which claims that the
> >> >> "module won't get loaded automatically" without it, but I have not
> >> >> had this problem, so I'm not sure why it's there.
> >> >
> >> > git grep bq27000-battery show me that only one driver uses that
> >> > name: drivers/w1/slaves/w1_bq27000.c
> >> >
> >> > And more over, it is platform device, not i2c device. So that
> >> > commit 8ebb7e9c1a502cfc300618c19c3c6f06fc76d237 is wrong! CCing
> >> > Marek.
> >>
> >> If you look to power/bq27x00 driver then there is I2C part and
> >> platform part only
> >> both selectable by config. In
> >> 8ebb7e9c1a502cfc300618c19c3c6f06fc76d237 was added MODULE_ALIAS to
> >> have this driver working as module for both buses. Even if I2C isn't
> >> used anywhere
> >> I add MODULE_ALIAS also for that.
> >>
> >> > MODULE_ALIAS("platform:bq27000-battery") is really needed for
> >> > w1_bq27000.c but MODULE_ALIAS("i2c:bq27000-battery") should be
> >> > removed. It is not used by any board platform code or DT.
> >>
> >> Not sure if it's good idea to remove it. Somebody outside can use it.
> >>
> >> > Marek, correct me if I'm wrong.
> >> >
> >> > --
> >> > Pali Rohár
> >> > pali.rohar@gmail.com
> >>
> >> BR,
> >>
> >> marek
> >
> > Who, where any why is using alias i2c:bq27000-battery??
> >
> > It is obviously wrong to add that alias. MODULE_DEVICE_TABLE(i2c, ...
> > macro automatically adds all MODULE_ALIASes for all i2c devices.
> Hmm are you sure? I think it's not true if you look to include/linux/module.h
> Those 2 macros have completely other purposes.

This is some magic which is generated to autogenerated c file when
compiling driver as module. Look at output from modinfo bq27x00_battery

Anyway, alias i2c:bq27000-battery is wrong and not only because it is
added by MODULE_ALIAS but also because bq27000 chip is HDQ and not i2c.

> >
> > If there is such device with needs i2c:bq27000-battery is should be
> > fixed to use i2c:bq27??? identifier exported by MODULE_DEVICE_TABLE.
> Look if you don't like it remove i2c part from driver and post patch.

I'm for removing i2c part and it can be done as part of Andrew's cleanup
patch.

> But as I said
> somebody can use it (not talking about vanilla tree).

Then they should fix their code.

> >
> > git grep on kernel tree did not return anything, so there is no usage.
> >
> > Of course alias for platform:bq27000-battery is needed.
> >
> > --
> > Pali Rohár
> > pali.rohar@gmail.com
> 
> BR,
> 
> marek
> 
> 
> 

-- 
Pali Rohár
pali.rohar@gmail.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web