Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8380518imu; Thu, 15 Nov 2018 10:34:38 -0800 (PST) X-Google-Smtp-Source: AJdET5csJ23S/MlXPlGWX8vNzUhNOHkTFTKbb+vIbZKf0SN/KOLqtCmqbi/JFgt35AgttMjlHP2z X-Received: by 2002:a63:334a:: with SMTP id z71mr6916487pgz.400.1542306878172; Thu, 15 Nov 2018 10:34:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542306878; cv=none; d=google.com; s=arc-20160816; b=0Ng2UhXXdMihisNerRfFF3lQPyjNIDx0hB3P+v4mGr6OvRl7iUmUVIfLCC7ErTTM36 +mxE3ss+7cjqgzDEy1BGa9hpM/Z17Lr2XutrfsMX3PC5XCPuYpIEjBkXtGKU+sxsUvui CuJ3O4dcsLKWF+O6B8003fEk59E0/TlG4Nm1s3HKT8B5yS7p3xF/Ukh8ddUWherzW+ID hxcmN5BIIzhzatBUbzFu0cPkS0WrhgK7J1gV1pIMULaeczec3HlyjPWjtL00wVLIYf7a //ATrtXmsx7H25szu3DgnXkeJb1r0yEqeCod8sIt3eKS/wwtshqAlIU3dDCFT5D02XlY 7E7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=5bAqr97VDlkpVI4iyXlxEvkaqPR8hL/l3TEgbhKJeAQ=; b=ZrgCWLlOeTO0tNXNhx17r8kIoUXMQwrzy1uPXjIkhIew4cWxTWEZwBRDZ0xG8k9cdb ZsX6nHpYneYsSwETijPPl7HI5Bxquc6Tf3H5N6U2wn2+ZZlTytoXkSlnWuT0bUqD9gqt Px4O6lA/xpaTV+RtYv9R0VZT4ifHnxsoAR9XnXXQ0KG9Z8uTVEc4HQUTy/K51jpa9QuX uGVAcuFmSoX+//Z3Y/pHPka0oHO6k5MhChbD53YxKbmRuaFZ8XxjNaKB1UX7/6iqHllc VVORkxzNdhkjrBaQrgVlXDNmq0EXx8ei0h/fwWolJwAkw0lJ66WielDv91XVlhjmL1iy 9S/A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l66si2257787pfi.5.2018.11.15.10.34.21; Thu, 15 Nov 2018 10:34:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388751AbeKPEmM (ORCPT + 99 others); Thu, 15 Nov 2018 23:42:12 -0500 Received: from shell.v3.sk ([90.176.6.54]:52195 "EHLO shell.v3.sk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726453AbeKPEmL (ORCPT ); Thu, 15 Nov 2018 23:42:11 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id 096A74C29E; Thu, 15 Nov 2018 19:33:13 +0100 (CET) Received: from shell.v3.sk ([127.0.0.1]) by localhost (zimbra.v3.sk [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id xs_PJB6PPo-S; Thu, 15 Nov 2018 19:33:09 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id 431B84C2A7; Thu, 15 Nov 2018 19:33:09 +0100 (CET) X-Virus-Scanned: amavisd-new at zimbra.v3.sk Received: from shell.v3.sk ([127.0.0.1]) by localhost (zimbra.v3.sk [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id J6DfqRzKAWQq; Thu, 15 Nov 2018 19:33:08 +0100 (CET) Received: from belphegor (nat-pool-brq-t.redhat.com [213.175.37.10]) by zimbra.v3.sk (Postfix) with ESMTPSA id 0F86D4C29E; Thu, 15 Nov 2018 19:33:08 +0100 (CET) Message-ID: <320e92fd7d942f364c83a1e8411629c1f8979d5f.camel@v3.sk> Subject: Re: [PATCH 12/15] power: supply: olpc_battery: Use DT to get battery version From: Lubomir Rintel To: Andy Shevchenko Cc: Mark Brown , Geert Uytterhoeven , Darren Hart , Andy Shevchenko , Greg Kroah-Hartman , quozl@laptop.org, Sebastian Reichel , Rob Herring , Mark Rutland , Eric Miao , Haojian Zhuang , Daniel Mack , Robert Jarzmik , linux-spi , devicetree , Linux Kernel Mailing List , linux-arm Mailing List , Platform Driver , devel@driverdev.osuosl.org, Linux PM Date: Thu, 15 Nov 2018 19:33:05 +0100 In-Reply-To: References: <20181010172300.317643-1-lkundrak@v3.sk> <20181010172300.317643-13-lkundrak@v3.sk> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.2 (3.30.2-2.fc29) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2018-10-19 at 16:45 +0300, Andy Shevchenko wrote: > On Wed, Oct 10, 2018 at 8:23 PM Lubomir Rintel > 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 > > --- > > 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 > > #include > > #include > > +#include > > #include > > Keep it sorted, otherwise the change is good! Yes, but... the headers are not sorted at the moment. I'll sort the new include before so that I don't mess it up even more, but I don't feel like just sorting everything so that I don't obscure the actual change. > Reviewed-by: Andy Shevchenko > > > > > @@ -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 > > Lubo