Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1015963iob; Thu, 12 May 2022 09:17:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/SETczj6rEERMLPDDpq6e3CsG2XVV3+l5uwzqmBM8RG0N+1y6UYu/wqhqJP6Uq728QgiU X-Received: by 2002:a05:6402:11cb:b0:427:7e52:eba5 with SMTP id j11-20020a05640211cb00b004277e52eba5mr36628614edw.17.1652372266711; Thu, 12 May 2022 09:17:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652372266; cv=none; d=google.com; s=arc-20160816; b=ozN4yC1YmRHC6bJLNFV8PWR2O+bmpQN+yaE3fxzXQk9aqDsMsLj6aOwarftfPxnXLx OVzS/RUrA4sKieqfohcyOnIfMLbse1EdCfhCvq9SPtIhiuvdO7AlrIcFLA5gdQeGcJeo hZftxh+YCKWphJ2xj2MdDdDP69zhw1FEhjcdKGoSK7N5YKdVxfETqTY/wtLJeaUwPVux GU/1hK1unk4MdjDAYp/mFMEoY+l7+3e/T38HDQU1s0096uJ9sMJ47jv//zTxsgFnQu/E AO5wZOMzd4WIb2pz1/QdDyjo/mlRcpeb8Iu0MQKWrLKpN5EEFl33Yz+catl2MschphpV o/MA== 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=Kf9i1b84UdMEp0GD80S9JuNplX2II5q6cyioxZsM/4s=; b=yQjMvrcMdOUxL3kLCfEwo8WSsJVGWyS67wixPImFE82HtG2NACZ/Uy/dOuq67W7p5A uO78wA3dNr/gpYq+Tl1Xa1B0/uwZfr1Cc3Kogc3iWS1CbwBrELwlBLrncYLAmPdYnlrB ALWzYRfHMPQc1MpfD79ZXIDH2tZFhtWsQlg5uKHH+0+j6RHk29YoD/nrMhV2v9JwkPIo AzhjwgDr35CYh0+OdC50Qso2cgD0E/hI0mdS3HmImiqI59pxOLqggbYysbJ8TYHOvywg MNVGZEaS6U/suQGN62lD3zaLZonvvcmIAtvhkgJJuz+CMPR6FnfT4kTbFYyJR6XjkrTh PtMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b="LAbr8X/c"; 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 js12-20020a17090797cc00b006efd1bca356si6421089ejc.629.2022.05.12.09.17.19; Thu, 12 May 2022 09:17:46 -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="LAbr8X/c"; 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 S243598AbiEKNTl (ORCPT + 99 others); Wed, 11 May 2022 09:19:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243646AbiEKNTO (ORCPT ); Wed, 11 May 2022 09:19:14 -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 88DF9239796; Wed, 11 May 2022 06:19:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1652275153; x=1683811153; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=Kf9i1b84UdMEp0GD80S9JuNplX2II5q6cyioxZsM/4s=; b=LAbr8X/c8hBQ1fuDGUrX930TLv3sScexKH7hFbiV6O47mw1X9dnJSt/T JRvm3W3WMUxCI4wsJMLwnABHmTiQk+MlNAfhXNDACC2Wd+rbJNVUy/3U8 QdbHQF5k3s/iJWtHo5VI+QE/z5X9iWNP3GxkFkQx5l1UOqIZ46va/xcwi M=; Received: from unknown (HELO ironmsg05-sd.qualcomm.com) ([10.53.140.145]) by alexa-out-sd-02.qualcomm.com with ESMTP; 11 May 2022 06:19:13 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg05-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2022 06:19:13 -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; Wed, 11 May 2022 06:19:12 -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; Wed, 11 May 2022 06:19:08 -0700 From: Satya Priya To: Bjorn Andersson , Rob Herring CC: Lee Jones , Liam Girdwood , Mark Brown , , , , , , , , Satya Priya Subject: [PATCH V12 5/9] mfd: pm8008: Remove the regmap member from pm8008_data struct Date: Wed, 11 May 2022 18:48:29 +0530 Message-ID: <1652275113-10277-6-git-send-email-quic_c_skakit@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1652275113-10277-1-git-send-email-quic_c_skakit@quicinc.com> References: <1652275113-10277-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,URIBL_BLOCKED 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 Reviewed-by: Stephen Boyd --- Changes in V12: - None. 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 5a670b0..569ffd50 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,14 +222,15 @@ 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); @@ -240,7 +240,7 @@ static int pm8008_probe(struct i2c_client *client) return PTR_ERR(reset_gpio); 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