Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2339198imj; Mon, 11 Feb 2019 00:47:58 -0800 (PST) X-Google-Smtp-Source: AHgI3IbyfsF+b5Q9Nm3YHMrmJLzeJvsuX//MdupX7MkNDvP4X0ItvhZ9ofTwjLfbGgJgCHIaDCwY X-Received: by 2002:a65:4b83:: with SMTP id t3mr7178404pgq.417.1549874878680; Mon, 11 Feb 2019 00:47:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549874878; cv=none; d=google.com; s=arc-20160816; b=OfDyTkZ47ePfpyJaeq1T5qwUZrQPh3QFKtd3uYFwli9Vz272eI7qhMOJs5IPYQCijw gtBv90c7lr+4UxcSiRMJjTPq+B9aQHpFHYmzRW9FklkLqrFDrC1CovMziROniFwaQrVf DXVvTS0ZWDV1J8soehue/AeYCq5cBkwi/gKs3L/5RjNlb/uhE3rNJdX6V23cr1kdBBXL jDrcAKFjeVu9ZAQQ74IYtqLmejt35Apt8jr2N7dhBhds0pq1p2V58eNVz76/XDHycP4A HOZBWo+lnP9/jzVcSk4w/WAdgtxakOLMUZdMFpunvkZaonnwdw4b7LABM+6TWG1pm5kA f05Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:user-agent:content-language:accept-language:in-reply-to :references:message-id:date:thread-index:thread-topic:subject:cc:to :from; bh=sQ2trrT2hDtu1uWVtMhfxsQSNYmCtLYk5AjblhJhU3M=; b=GlOFOAKIBgX82SGwHyoX6fRpgELyscJ5O5cBQiuIVPThTt6HOywPiDu5IdorClWCRI fdn5rD5DbdAJXMNb9PXJ5oo4dtNZpJ984gYf4ZwKSU81uLX8bAyi4anqOczy345OLTDk izLwU3OvxF8KzMqAWnVbF+oWWyNXnPZJUMiUYZKBXeCYY8mOIuHSP5LYmnNgQ4TXMuSZ XHRlJ7kgwdSSvi4ZkWAoODjseJf1StuXDguEC034scQ+HavcXNIHCvXZtuLVLTCfNTNs 5bsutIE7DoTAeh3Xpi2fDjRuzvedZ/mIJ57Tw81hQjx07SY6vhto4L6V18o4bc+qaE+W WR5A== 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 j10si8281368pgp.282.2019.02.11.00.47.42; Mon, 11 Feb 2019 00:47:58 -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 S1727249AbfBKIq1 convert rfc822-to-8bit (ORCPT + 99 others); Mon, 11 Feb 2019 03:46:27 -0500 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:53012 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725931AbfBKIq1 (ORCPT ); Mon, 11 Feb 2019 03:46:27 -0500 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x1B8fraO018517; Mon, 11 Feb 2019 09:46:22 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2qjfy5w1m6-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 11 Feb 2019 09:46:22 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 7137031; Mon, 11 Feb 2019 08:46:21 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag6node1.st.com [10.75.127.16]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 1C06B2452; Mon, 11 Feb 2019 08:46:21 +0000 (GMT) Received: from SFHDAG6NODE2.st.com (10.75.127.17) by SFHDAG6NODE1.st.com (10.75.127.16) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Mon, 11 Feb 2019 09:46:20 +0100 Received: from SFHDAG6NODE2.st.com ([fe80::a56f:c186:bab7:13d6]) by SFHDAG6NODE2.st.com ([fe80::a56f:c186:bab7:13d6%20]) with mapi id 15.00.1347.000; Mon, 11 Feb 2019 09:46:20 +0100 From: Pascal PAILLET-LME To: Axel Lin , Mark Brown CC: Liam Girdwood , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] regulator: stpmic1: Remove regul_id and *regmap from struct stpmic1_regulator Thread-Topic: [PATCH] regulator: stpmic1: Remove regul_id and *regmap from struct stpmic1_regulator Thread-Index: AQHUweZCcYMyvoWnsU+q1IYB39nl4w== Date: Mon, 11 Feb 2019 08:46:20 +0000 Message-ID: <5C61365C.8050709@st.com> References: <20190209043935.24637-1-axel.lin@ingics.com> In-Reply-To: <20190209043935.24637-1-axel.lin@ingics.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.75.127.50] Content-Type: text/plain; charset="Windows-1252" Content-ID: Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-02-11_06:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Axel, Le 02/09/2019 05:39 AM, Axel Lin a ?crit : > At the context with *rdev available, there is no problem to get regulator > id and *regmap, so no need to store them in struct stpmic1_regulator. > > Signed-off-by: Axel Lin > --- > drivers/regulator/stpmic1_regulator.c | 10 ++-------- > 1 file changed, 2 insertions(+), 8 deletions(-) > > diff --git a/drivers/regulator/stpmic1_regulator.c b/drivers/regulator/stpmic1_regulator.c > index 963e67fa9ca6..dd5c8fb1ff86 100644 > --- a/drivers/regulator/stpmic1_regulator.c > +++ b/drivers/regulator/stpmic1_regulator.c > @@ -30,20 +30,16 @@ struct stpmic1_regulator_cfg { > > /** > * stpmic1 regulator data: this structure is used as driver data > - * @regul_id: regulator id > * @reg_node: DT node of regulator (unused on non-DT platforms) > * @cfg: stpmic specific regulator description > * @mask_reset: mask_reset bit value > * @irq_curlim: current limit interrupt number > - * @regmap: point to parent regmap structure > */ > struct stpmic1_regulator { > - unsigned int regul_id; > struct device_node *reg_node; > const struct stpmic1_regulator_cfg *cfg; > u8 mask_reset; > int irq_curlim; > - struct regmap *regmap; > }; > > static int stpmic1_set_mode(struct regulator_dev *rdev, unsigned int mode); > @@ -477,7 +473,7 @@ static int stpmic1_set_icc(struct regulator_dev *rdev) > struct stpmic1_regulator *regul = rdev_get_drvdata(rdev); > > /* enable switch off in case of over current */ > - return regmap_update_bits(regul->regmap, regul->cfg->icc_reg, > + return regmap_update_bits(rdev->regmap, regul->cfg->icc_reg, > regul->cfg->icc_mask, regul->cfg->icc_mask); Maybe this is not compatible with a recommandation from include/linux/regulator/driver.h:438: * This should *not* be used directly by anything except the regulator * core and notification injection (which should take the mutex and do * no other direct access). > } > ... thank you, pascal