From: Anton Vorontsov <avorontsov@ru.mvista.com>
To: Dmitry Baryshkov <dbaryshkov@gmail.com>
Cc: linux-kernel@vger.kernel.org, cbou@mail.ru,
Andrew Morton <akpm@linux-foundation.org>,
Marek Vasut <marek.vasut@gmail.com>,
Jonathan Cameron <Jonathan.Cameron@gmail.com>
Subject: Re: [PATCH] power_supply: change the way how wm97xx-bat driver is registered
Date: Mon, 3 Nov 2008 22:34:55 +0300 [thread overview]
Message-ID: <20081103193455.GA17958@oksana.dev.rtsoft.ru> (raw)
In-Reply-To: <20081103182955.GA17171@doriath.ww600.siemens.net>
On Mon, Nov 03, 2008 at 09:29:55PM +0300, Dmitry Baryshkov wrote:
> On Mon, Nov 03, 2008 at 06:11:51PM +0300, Anton Vorontsov wrote:
> > On Wed, Oct 29, 2008 at 12:04:10PM +0300, Dmitry Baryshkov wrote:
> > > #ifdef CONFIG_BATTERY_WM97XX
> > > -void __init wm97xx_bat_set_pdata(struct wm97xx_batt_info *data);
> > > +int wm97xx_bat_set_pdata(struct wm97xx_batt_info *data);
> > > #else
> > > -static inline void wm97xx_bat_set_pdata(struct wm97xx_batt_info *data) {}
> > > +static inline int wm97xx_bat_set_pdata(struct wm97xx_batt_info *data)
> > > +{
> > > + return -ENODEV;
> > > +}
> > > #endif
> >
> > How that supposed to work when BATTERY_WM97XX is a module?
> > #ifdef CONFIG_BATTERY_WM97XX will evaluate to false, and you'll have
> > dummy wm97xx_bat_set_pdata() that returns -ENODEV...
>
> This won't of course fix the wm97xx driver model, but the module issue
> should be fixed. What about this patch?
[...]
> -#ifdef CONFIG_BATTERY_WM97XX
> -void __init wm97xx_bat_set_pdata(struct wm97xx_batt_info *data);
> +#if defined(CONFIG_BATTERY_WM97XX) || defined(CONFIG_BATTERY_WM97XX_MODULE)
> +int wm97xx_bat_set_pdata(struct wm97xx_batt_info *data);
In case of CONFIG_BATTERY_WM97XX_MODULE, the build will break at link
time, since wm97xx_bat_set_pdata() might be called from the built-in
code (i.e. arch/arm/mach-pxa/palmtx.c).
> #else
> -static inline void wm97xx_bat_set_pdata(struct wm97xx_batt_info *data) {}
> +static inline int wm97xx_bat_set_pdata(struct wm97xx_batt_info *data)
> +{
> + return -ENODEV;
> +}
> #endif
>
> #endif
> --
> 1.5.6.5
--
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2
next prev parent reply other threads:[~2008-11-03 19:35 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-29 9:04 [PATCH] power_supply: only register tosa_battery driver on tosa Dmitry Baryshkov
2008-10-29 9:04 ` [PATCH] power_supply: change the way how wm97xx-bat driver is registered Dmitry Baryshkov
2008-11-02 20:36 ` Dmitry
2008-11-02 23:41 ` Marek Vasut
2008-11-03 15:11 ` Anton Vorontsov
2008-11-03 16:54 ` Jonathan Cameron
2008-11-03 17:21 ` Anton Vorontsov
2008-11-03 18:29 ` Dmitry Baryshkov
2008-11-03 19:34 ` Anton Vorontsov [this message]
2008-11-02 20:36 ` [PATCH] power_supply: only register tosa_battery driver on tosa Dmitry
2008-11-03 14:55 ` Anton Vorontsov
2008-11-03 16:20 ` Dmitry
2008-11-03 16:25 ` Anton Vorontsov
2008-11-03 16:41 ` Dmitry
2008-11-03 16:58 ` Anton Vorontsov
2008-11-03 17:09 ` Dmitry
2008-11-03 17:32 ` Anton Vorontsov
2008-11-03 18:14 ` Dmitry
2008-11-03 17:41 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081103193455.GA17958@oksana.dev.rtsoft.ru \
--to=avorontsov@ru.mvista.com \
--cc=Jonathan.Cameron@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=cbou@mail.ru \
--cc=dbaryshkov@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marek.vasut@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox