lkml.org 
[lkml]   [2015]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 3/3] power: bq27xxx_battery: fix defined but not used warnings
    On Friday 16 October 2015 15:44:12 Sebastian Reichel wrote:
    > If BQ27XXX is enabled, but neither I2C based initialization, nor
    > platform based initialization are activated, bq27xxx_powersupply_init
    > and bq27xxx_powersupply_unregister are defined but not used.
    >
    > This configuration doesn't make sense, but there is no easy way
    > to make it unavailable in the build system, so just mark the
    > functions as __maybe_unused instead.
    >

    What about?

    #if defined(CONFIG_1) || defined(CONFIG_2)
    #define NEED_POWER_SUPPLY
    #endif

    And then wrap power supply code into #ifdef NEED_POWER_SUPPLY?

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


    \
     
     \ /
      Last update: 2015-10-16 17:21    [W:4.714 / U:0.000 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site