lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 19 Oct 2018 16:45:03 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Lubomir Rintel <lkundrak@...sk>
Cc:     Mark Brown <broonie@...nel.org>,
        Geert Uytterhoeven <geert+renesas@...der.be>,
        Darren Hart <dvhart@...radead.org>,
        Andy Shevchenko <andy@...radead.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        quozl@...top.org, Sebastian Reichel <sre@...nel.org>,
        Rob Herring <robh+dt@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Eric Miao <eric.y.miao@...il.com>,
        Haojian Zhuang <haojian.zhuang@...il.com>,
        Daniel Mack <daniel@...que.org>,
        Robert Jarzmik <robert.jarzmik@...e.fr>,
        linux-spi <linux-spi@...r.kernel.org>,
        devicetree <devicetree@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        linux-arm Mailing List <linux-arm-kernel@...ts.infradead.org>,
        Platform Driver <platform-driver-x86@...r.kernel.org>,
        devel@...verdev.osuosl.org, Linux PM <linux-pm@...r.kernel.org>
Subject: Re: [PATCH 12/15] power: supply: olpc_battery: Use DT to get battery version

On Wed, Oct 10, 2018 at 8:23 PM Lubomir Rintel <lkundrak@...sk> wrote:
>
> Avoid using the x86 OLPC platform specific call to get the board
> version. It won't work on FDT-based ARM MMP2 platform.
>
> Signed-off-by: Lubomir Rintel <lkundrak@...sk>
> ---
>  drivers/power/supply/olpc_battery.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/power/supply/olpc_battery.c b/drivers/power/supply/olpc_battery.c
> index 5a97e42a3547..540d44bf536f 100644
> --- a/drivers/power/supply/olpc_battery.c
> +++ b/drivers/power/supply/olpc_battery.c
> @@ -19,6 +19,7 @@
>  #include <linux/jiffies.h>
>  #include <linux/sched.h>
>  #include <linux/olpc-ec.h>
> +#include <linux/of.h>
>  #include <asm/olpc.h>

Keep it sorted, otherwise the change is good!

Reviewed-by: Andy Shevchenko <andy.shevchenko@...il.com>

>
>
> @@ -622,11 +623,13 @@ static int olpc_battery_probe(struct platform_device *pdev)
>         olpc_ac = power_supply_register(&pdev->dev, &olpc_ac_desc, NULL);
>         if (IS_ERR(olpc_ac))
>                 return PTR_ERR(olpc_ac);
> -
> -       if (olpc_board_at_least(olpc_board_pre(0xd0))) { /* XO-1.5 */
> +       if (of_property_match_string(pdev->dev.of_node, "compatible",
> +                                       "olpc,xo1.5-battery") >= 0) {
> +               /* XO-1.5 */
>                 olpc_bat_desc.properties = olpc_xo15_bat_props;
>                 olpc_bat_desc.num_properties = ARRAY_SIZE(olpc_xo15_bat_props);
> -       } else { /* XO-1 */
> +       } else {
> +               /* XO-1 */
>                 olpc_bat_desc.properties = olpc_xo1_bat_props;
>                 olpc_bat_desc.num_properties = ARRAY_SIZE(olpc_xo1_bat_props);
>         }
> @@ -672,6 +675,7 @@ static int olpc_battery_remove(struct platform_device *pdev)
>
>  static const struct of_device_id olpc_battery_ids[] = {
>         { .compatible = "olpc,xo1-battery" },
> +       { .compatible = "olpc,xo1.5-battery" },
>         {}
>  };
>  MODULE_DEVICE_TABLE(of, olpc_battery_ids);
> --
> 2.19.0
>


-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ