Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp288009imj; Fri, 8 Feb 2019 20:40:27 -0800 (PST) X-Google-Smtp-Source: AHgI3IYWUohJ/w0Cbj5X/B2B9NqPM4SIoyws1cno4NkzFoJShR6BdiHe24aeKbMD/7F5bBLphCSL X-Received: by 2002:a17:902:449:: with SMTP id 67mr17992040ple.310.1549687227396; Fri, 08 Feb 2019 20:40:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549687227; cv=none; d=google.com; s=arc-20160816; b=AA2qajl/qdd3wd7EYYsCYsY1W9JNthnWsvzqGAAh6FQOu88j4acJFGdaXP8r/T3+le +5tWJByzXe6Qwiz/5M5bFwWhzACnFZfZeWETMaGbreaADToJ0EXQHyo86o2/ewhHlYPr 4TCpizYqZfM9aHKrQNFg8xCblRsjQZTrxQ1NF9MF1gkpyaI3wAvyv+swudYkzcgMj/KB 9N6IX+xHP/ZMTiZ7LdzqrkrHgglVr1RQNjEWd4elPzX0PRhJ1PxjNXsMv+e1d1730X+Y c+oc8TqBkWTqdERvoR7H0GOnuhB1/xfzLF+QVUSKdHRAQ76RZjau4G3GWjIdDWIZZJcG NX9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=6eWteoO5+iSWVFhMx+sefIbG224Q6c2m9104t5OMn2g=; b=ddAKTCAES9svBFuov3jMsF/IPP+c1xwACSBrydSTDob+tMZA+g+vi9ZVF+AzQ89n7Y 83IGa5nKqCZhqdBc1Hu3Udvsaf0XZFnd2453SmKX+RPgbImkSAgC3yW3dgwDAykqWhPq 1ZGTR0vN7b9xuSAArdljKYHi9m8JamyR8McquBqbvVGwB/JNBzADH8pduTaOsGgitfJS euw9XhYy5BCRLkyTzTyi3k7lkBEtY5/euPYkLBHyGLhRmkzWFJvJdwYgTtcrgCQ1D0rS NPvpt2zM7P3XI2QJYwBKn74Muy/lEVfRWpc0+CSx4DQUdfHzFNPlqBUCg0GwO0jSGuE0 vWJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ingics-com.20150623.gappssmtp.com header.s=20150623 header.b=RsdTMO7R; 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 f11si4145302plo.254.2019.02.08.20.39.56; Fri, 08 Feb 2019 20:40:27 -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; dkim=pass header.i=@ingics-com.20150623.gappssmtp.com header.s=20150623 header.b=RsdTMO7R; 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 S1726755AbfBIEjv (ORCPT + 99 others); Fri, 8 Feb 2019 23:39:51 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:43459 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726222AbfBIEjv (ORCPT ); Fri, 8 Feb 2019 23:39:51 -0500 Received: by mail-pf1-f193.google.com with SMTP id w73so2614095pfk.10 for ; Fri, 08 Feb 2019 20:39:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ingics-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=6eWteoO5+iSWVFhMx+sefIbG224Q6c2m9104t5OMn2g=; b=RsdTMO7RLN9VJ8he1cj7h1kU1lwPANOX/t0CutF0oa2wHgthhlCK+Xwrfc8v2//n+b 750N12g78e9H3mTSnoIH6AuL614b8beInIViJ7oyrW1kP7RhmrL5NRt9rCR9dJvbaPnj 40Lxn7XvpDgQVOdL6IN9cIfuc4bxjY4cRNtfLThiDb0B7+AxGPPgzGdwcLtBzhgCL8o/ SoAfbaTlKz5tql0/53yoaa39F8LadT5AEHI2/XTZzrE8ZkbBfDztG+Sh+cQCZadAFLfB SgCO7KSU9VuwVaya4mr5fMpoceaFA0I/dOZb0Z7rF6g1Rb0zxdr46ju7wq9AwrTU6UUz ls3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=6eWteoO5+iSWVFhMx+sefIbG224Q6c2m9104t5OMn2g=; b=mYuGZ8Ct9NxZtiguES+QdXd8rnshlplkI58FAPzx4i9v3PcG2uxjgTQ+QT+oGGIPrM VGOy3yqcfwyjZWDwjuUt3tnD0zcZZVuIcONcQkZd+DTGiOH/5IuxTty2IlbO/6dEoG6I zZmEgXskcVcz2G7c/JxLIC2WJB4N6MVG1ZQuw/2VXDIDA7UiyipRzMxabvnxQ4rDCZwn oEuZ2V/sO9cPozxFvgM2kgGGZCx1/q8AmYH3L/6V1YC7vEQCzMe8+fqNan1o+4g54u5p HKAZh9nNLX2EBxcdcMaTOhhj+NKAhAN4bo8eh1pZLnBAaCaUZaTGIVwedqPpAHHc93IK Wskw== X-Gm-Message-State: AHQUAuYXPM3WL8Zg3I47ZYaHVf5rD/nKXaIAW82BYUhsFJURz1KYrMQu zNzYRVWi9E7pcTn/QlrIWQP+TA== X-Received: by 2002:a63:ea42:: with SMTP id l2mr9738259pgk.213.1549687190264; Fri, 08 Feb 2019 20:39:50 -0800 (PST) Received: from localhost.localdomain (36-239-237-75.dynamic-ip.hinet.net. [36.239.237.75]) by smtp.gmail.com with ESMTPSA id e123sm4018274pgc.58.2019.02.08.20.39.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Feb 2019 20:39:49 -0800 (PST) From: Axel Lin To: Mark Brown Cc: Pascal Paillet , Liam Girdwood , linux-kernel@vger.kernel.org, Axel Lin Subject: [PATCH] regulator: stpmic1: Remove regul_id and *regmap from struct stpmic1_regulator Date: Sat, 9 Feb 2019 12:39:35 +0800 Message-Id: <20190209043935.24637-1-axel.lin@ingics.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); } @@ -505,7 +501,7 @@ static int stpmic1_regulator_init(struct platform_device *pdev, /* set mask reset */ if (regul->mask_reset && regul->cfg->mask_reset_reg != 0) { - ret = regmap_update_bits(regul->regmap, + ret = regmap_update_bits(rdev->regmap, regul->cfg->mask_reset_reg, regul->cfg->mask_reset_mask, regul->cfg->mask_reset_mask); @@ -584,10 +580,8 @@ regulator_dev *stpmic1_regulator_register(struct platform_device *pdev, int id, config.regmap = pmic_dev->regmap; config.driver_data = regul; - regul->regul_id = id; regul->reg_node = config.of_node; regul->cfg = &stpmic1_regulator_cfgs[id]; - regul->regmap = pmic_dev->regmap; rdev = devm_regulator_register(&pdev->dev, ®ul->cfg->desc, &config); if (IS_ERR(rdev)) { -- 2.17.1