lkml.org 
[lkml]   [2014]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC PATCH v2 2/4] regulator: act8865: Add support to turn off all outputs
    On Tue, Oct 07, 2014 at 07:45:02PM +0000, Romain Perier wrote:
    > When the property "poweroff-source" is found in the
    > devicetree, the function pm_power_off is defined. This function sends the
    > rights bit fields to the global off control register. shutdown/poweroff
    > commands are now supported for hardware components which use these PMU.

    Reviwed-by: Mark Brown <broonie@kernel.org>

    but...

    > + if (dev->of_node && is_system_poweroff_source(dev->of_node) &&
    > + !pm_power_off) {
    > + act8865_i2c_client = client;
    > + act8865->off_reg = off_reg;
    > + act8865->off_mask = off_mask;
    > + pm_power_off = act8865_power_off;
    > + }

    Perhaps worth wrapping the dev->of_node check into the function? I
    imagine the same pattern will be quite common.

    Might also make sense to warn if we've got the property but we're not
    setting pm_power_off - it's indicating that things aren't working as
    expected, an error will help users figure out what's going wrong.
    [unhandled content-type:application/pgp-signature]
    \
     
     \ /
      Last update: 2014-10-13 16:01    [W:3.928 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site