Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3191149imm; Fri, 19 Oct 2018 06:41:55 -0700 (PDT) X-Google-Smtp-Source: ACcGV61or3gb2AI6LXycmSA3Ntfe+ZkjUAsdtMaRw+kLA+hdi/xuCTP0P7DggQOk3AtTjNTrANlS X-Received: by 2002:a63:cf0e:: with SMTP id j14-v6mr32541347pgg.195.1539956515157; Fri, 19 Oct 2018 06:41:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539956515; cv=none; d=google.com; s=arc-20160816; b=P7Uvxq7ap7p1LLOO2y6lzL+pxC5ONbkxIx/yOsbE8vxbfkMACCJrPIn0q2Y/9Ip9bB SDUQayrSxM7ngXmGKtnnIPffSrPqugCjRFu/oy9mc37elAosWADn9ya0y6KVFPvum1CP nfFxuMP++WGX+JbTj+CBVkFZwdX6d+Gu3+rHhepzTJuIwdDqheANxjVdk4Fvqk56E3J0 xSmNEyMNPNbO38Mw1iKJCf2eaADE0JptYEWATCgB8UI8JolfBqWW5oKemw+7mJxgNs1L eBfHulq8ORg32UJN4zM1URiq+ejpYO+aqJ4qqWBHvsG/1a0N1vlqwIsh8OAku4D9/4Wb idSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=+vpiaLaLMi/AXmZ69e+QiLJnlaqPAl7+SFQzHn5Neoo=; b=XwZCn/PI+gNc/7TeWa0/zBbrmNg2M99YU8eRXTbHTbqyJdley4z3wo9zRwR3ApgcY7 YmGvBj1g/AYpV+HbOaVEprRH/rynsgb3+8OwlihaPgEduVkH/yJIYSMnPmVpnQ9Y7lCC +PZ7rynWdWy4AXxDgIn+tSjs3ccGWwEJHZHoFedXwMMTwNxjPmPNyDPS6iY9jcUFQD2e ew489okH6jqMGZDjoAdRSFvlX4n3ldu7VI1L0ic5WxJyFc63I6ZsbRj9fYhk7tG+fL7B Q8q1UFDFitiVVyyvhuZAsuopsjiOz+jV1ByqZ8cPEDFDU/+UbOLVKfIK/XW/VyouQUbl CDEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=f90ll0rY; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k5-v6si24431124pgi.99.2018.10.19.06.41.39; Fri, 19 Oct 2018 06:41:55 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=f90ll0rY; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727748AbeJSVp6 (ORCPT + 99 others); Fri, 19 Oct 2018 17:45:58 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:44502 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727377AbeJSVp5 (ORCPT ); Fri, 19 Oct 2018 17:45:57 -0400 Received: by mail-qt1-f195.google.com with SMTP id x24-v6so6696832qtx.11; Fri, 19 Oct 2018 06:39:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+vpiaLaLMi/AXmZ69e+QiLJnlaqPAl7+SFQzHn5Neoo=; b=f90ll0rYu9PbRm71GsMcqrT09h7ro0Ifh1DXEEYceOB0Y+IwKjW1V3T2CGwS8wFAbJ l9GjQkSeRSYbbH1+2ikc4BYOdg3q1+0mA0X41PizAnOr8qpQOgSqSwQ1v/241KyTjcb9 3MGPM2b2U241thh/NAgZsFsETmOpwLRDs3rbMHdcyEFJ343Vwh5EzY2SpySrJfmzLR8C FOX1CzrE0pPLplIwXRdoJFQ4GLKb+L+rrd6rjC3p5qtKMeW/bNuj/mdMI0IqW79ESl5k u2ahVR/3FhqzvcT/75Zh3zTQJ0fsPCTJOD86/0m6WTK4duUa1FNONjVbsTvB9iURSeci 4YQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+vpiaLaLMi/AXmZ69e+QiLJnlaqPAl7+SFQzHn5Neoo=; b=OzJD/JroNb4BqCzVt9coRRgHxl8RZfBa4eXZGNpmivIn+qilWcMJXCh0a2iHMUhwgL lliqCJuojQxrnTBkL9VmIZVAhcL8Aqo2VkAtAnGMowMn1oxDYzV4DYglWEJgvcMeOww5 zEFCXKpj2lJ1Dwic53ngQi7IP2MwSoe94KmPU+7YCnzFwKxubOhoUUgCPQaKT+Y+ngwK 73xh+9QFdr0/RlRSjAp2JSXKQMxW7VGspwijtFvOPKHfrx6gKlUN+HBw0wygAJ2DhP0a l6JvoRdxFcz8KrxvTCe00M3U6buBk+5B36jxwD4sMbQUxsnqCjlpVhv7xWZBLOxTYzWK IH9g== X-Gm-Message-State: ABuFfoikyoo9Ngng2Nz6n/JCtLWSbdurrvd8v3xXT3C6MA6KYo+6WI/r V0yfqqVYvqiagewV3025M7HnZwPHsaPMl+nU6pU= X-Received: by 2002:ac8:2413:: with SMTP id c19-v6mr32674150qtc.194.1539956386643; Fri, 19 Oct 2018 06:39:46 -0700 (PDT) MIME-Version: 1.0 References: <20181010172300.317643-1-lkundrak@v3.sk> <20181010172300.317643-10-lkundrak@v3.sk> In-Reply-To: <20181010172300.317643-10-lkundrak@v3.sk> From: Andy Shevchenko Date: Fri, 19 Oct 2018 16:39:35 +0300 Message-ID: Subject: Re: [PATCH 09/15] Platform: OLPC: add a regulator for the DCON To: Lubomir Rintel 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 10, 2018 at 8:23 PM Lubomir Rintel wrote: > > All OLPC ECs are able to turn the power to the DCON on an off. Use the > regulator framework to expose the functionality. > +static int olpc_ec_set_dcon_power(struct olpc_ec_priv *ec, bool state) > +{ > + unsigned char ec_byte = state; > + int ret; > + > + if (ec->dcon_enabled == state) > + return 0; > + > + ret = olpc_ec_cmd(EC_DCON_POWER_MODE, &ec_byte, 1, NULL, 0); > + if (ret == 0) > + ec->dcon_enabled = state; > + > + return ret; I would prefer to see usual pattern, i.e. if (ret) return ret; ... return 0; This comment applies to entire series. (Yes, you might address an old code in a separate patch to be on consistent side) > +} > + return olpc_ec_set_dcon_power(ec, 1); defined as boolean, supplied an int. Not good. > + return olpc_ec_set_dcon_power(ec, 0); Ditto. > +static int dcon_regulator_is_enabled(struct regulator_dev *rdev) > + return ec->dcon_enabled; Ditto. -- With Best Regards, Andy Shevchenko