Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1859820iob; Thu, 5 May 2022 09:32:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxAl6Mlw6eox0MSuaoZbP70lyHPa6fOgK9XmuW2nKsAva7D8vegXQ7Qeu16TSlBDgpQlVt4 X-Received: by 2002:a17:903:2406:b0:158:f6f0:6c44 with SMTP id e6-20020a170903240600b00158f6f06c44mr28026193plo.88.1651768321490; Thu, 05 May 2022 09:32:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651768321; cv=none; d=google.com; s=arc-20160816; b=AavLeVkd49fbt0KLDkIX5Y6mBwOVya6JKt4Sya1yj4UOf4NfK+dG3JHs0KEf1KF3j2 j0FMf4vdb7x5N5czy6PWamR/aIrvtRg6ggzXli9XkUaX6C0rYw9iHiA+3ztPbi988m5a 0rnIAK7FR816piSRW3bG9cvuBsFfgmU3mr3zeCCgpvRief0xT7biUUsHRe6RyPfLSma4 PJMdMvG3X1poxUC/U4q7h8Ed7+QCScu5n7S9huK0J45f5d7Vr2/A//fxsaKGvugXTe4H K5jZQlCLlCSps43lv8XhJT5qUDTRDU3+gvfrnWYj8TRUzewfzXKbF7bk3D8XUrajaVRb a3bQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=up4hMD6GQlgzuzfjMTnPw2wyrJcOi4thfB2HEMSKDs0=; b=lj/Fmfjfu2LXGcRODIqf59Gt8dWfez2LfdwiT0UcOzdyUI05w2R2U9UPjwndFv0ppd PqyYKIL3CyhjL7Tm4kuinjJAE6R7urvxgTXn9OLQOdMp5s2w4buefE7RnBEhYyMtP1Xa q+N1KRClqviM4mWCDH/u40DRTOqjOLjx4dbOU4KE+ymou+MiXn0obKtwnCJcfFaGziJh IBYCydCqhG7BEE6Kl1Pcz9TfC2vPJXgj6ul1f/SsTpZOJg3jOPsKcefUxgmJ1sCESSZq vSK3w49jyz9wQcoEvY20J+EdbHuYehtyGnbk9iNbEnJ05jdDFc/DhYJdvIpcdhT1sMau 9lnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=VvNKFQLC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t11-20020a170902bc4b00b0015d1c611e6asi2043456plz.520.2022.05.05.09.31.41; Thu, 05 May 2022 09:32:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=VvNKFQLC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353387AbiEEJbE (ORCPT + 99 others); Thu, 5 May 2022 05:31:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353471AbiEEJai (ORCPT ); Thu, 5 May 2022 05:30:38 -0400 Received: from alexa-out-sd-02.qualcomm.com (alexa-out-sd-02.qualcomm.com [199.106.114.39]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34E384EDD9; Thu, 5 May 2022 02:26:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1651742819; x=1683278819; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=up4hMD6GQlgzuzfjMTnPw2wyrJcOi4thfB2HEMSKDs0=; b=VvNKFQLC7KyjoOq7GPhs4LnIEfRCUYUg+ZIlB/WlZivFB1QtwQTBcbzC r46p5Q7TtBr+TkxYXS5eaj4+fMVzFyM8C6HzZRHeQTjFaVN0p6szyxK1i +hxg59lfYfaOZ6R/rjoEjd1aQ64K7SWIsj88apOgFtk5WSkShdsMTdBMp Q=; Received: from unknown (HELO ironmsg02-sd.qualcomm.com) ([10.53.140.142]) by alexa-out-sd-02.qualcomm.com with ESMTP; 05 May 2022 02:26:58 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg02-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2022 02:26:58 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Thu, 5 May 2022 02:26:58 -0700 Received: from c-skakit-linux.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Thu, 5 May 2022 02:26:53 -0700 From: Satya Priya To: Bjorn Andersson , Rob Herring CC: Lee Jones , Liam Girdwood , Mark Brown , , , , , , , , Satya Priya Subject: [PATCH V11 5/9] mfd: pm8008: Remove the regmap member from pm8008_data struct Date: Thu, 5 May 2022 14:55:35 +0530 Message-ID: <1651742739-12338-6-git-send-email-quic_c_skakit@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1651742739-12338-1-git-send-email-quic_c_skakit@quicinc.com> References: <1651742739-12338-1-git-send-email-quic_c_skakit@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove the regmap member from pm8008_data struct as it is not used outside of probe. Add a local variable for regmap and pass it to the pm8008_probe_irq_peripherals() API in pm8008_probe. Signed-off-by: Satya Priya --- Changes in V11: - New patch added from V11. drivers/mfd/qcom-pm8008.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/mfd/qcom-pm8008.c b/drivers/mfd/qcom-pm8008.c index e7c3b32..40a67f0 100644 --- a/drivers/mfd/qcom-pm8008.c +++ b/drivers/mfd/qcom-pm8008.c @@ -57,7 +57,6 @@ enum { struct pm8008_data { struct device *dev; - struct regmap *regmap; int irq; struct regmap_irq_chip_data *irq_data; }; @@ -151,7 +150,7 @@ static struct regmap_config qcom_mfd_regmap_cfg = { .max_register = 0xFFFF, }; -static int pm8008_init(struct pm8008_data *chip) +static int pm8008_init(struct regmap *regmap) { int rc; @@ -161,32 +160,32 @@ static int pm8008_init(struct pm8008_data *chip) * This is required to enable the writing of TYPE registers in * regmap_irq_sync_unlock(). */ - rc = regmap_write(chip->regmap, + rc = regmap_write(regmap, (PM8008_TEMP_ALARM_ADDR | INT_SET_TYPE_OFFSET), BIT(0)); if (rc) return rc; /* Do the same for GPIO1 and GPIO2 peripherals */ - rc = regmap_write(chip->regmap, + rc = regmap_write(regmap, (PM8008_GPIO1_ADDR | INT_SET_TYPE_OFFSET), BIT(0)); if (rc) return rc; - rc = regmap_write(chip->regmap, + rc = regmap_write(regmap, (PM8008_GPIO2_ADDR | INT_SET_TYPE_OFFSET), BIT(0)); return rc; } static int pm8008_probe_irq_peripherals(struct pm8008_data *chip, - int client_irq) + struct regmap *regmap, int client_irq) { int rc, i; struct regmap_irq_type *type; struct regmap_irq_chip_data *irq_data; - rc = pm8008_init(chip); + rc = pm8008_init(regmap); if (rc) { dev_err(chip->dev, "Init failed: %d\n", rc); return rc; @@ -208,7 +207,7 @@ static int pm8008_probe_irq_peripherals(struct pm8008_data *chip, IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW); } - rc = devm_regmap_add_irq_chip(chip->dev, chip->regmap, client_irq, + rc = devm_regmap_add_irq_chip(chip->dev, regmap, client_irq, IRQF_SHARED, 0, &pm8008_irq_chip, &irq_data); if (rc) { dev_err(chip->dev, "Failed to add IRQ chip: %d\n", rc); @@ -223,20 +222,21 @@ static int pm8008_probe(struct i2c_client *client) int rc; struct pm8008_data *chip; struct gpio_desc *reset_gpio; + struct regmap *regmap; chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL); if (!chip) return -ENOMEM; chip->dev = &client->dev; - chip->regmap = devm_regmap_init_i2c(client, &qcom_mfd_regmap_cfg); - if (!chip->regmap) + regmap = devm_regmap_init_i2c(client, &qcom_mfd_regmap_cfg); + if (!regmap) return -ENODEV; i2c_set_clientdata(client, chip); if (of_property_read_bool(chip->dev->of_node, "interrupt-controller")) { - rc = pm8008_probe_irq_peripherals(chip, client->irq); + rc = pm8008_probe_irq_peripherals(chip, regmap, client->irq); if (rc) dev_err(chip->dev, "Failed to probe irq periphs: %d\n", rc); } -- 2.7.4