Received: by 2002:a05:7412:f584:b0:e2:908c:2ebd with SMTP id eh4csp1116369rdb; Mon, 4 Sep 2023 03:43:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGTHDPxaZFsl3+dp0hRc+DTTZ65SpMnWjkxcL6xXAam6owWpzoo0ny54Tzxanaa2F/VXqWz X-Received: by 2002:a05:6a20:8e1f:b0:14c:e1ee:7608 with SMTP id y31-20020a056a208e1f00b0014ce1ee7608mr13699653pzj.9.1693824203171; Mon, 04 Sep 2023 03:43:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693824203; cv=none; d=google.com; s=arc-20160816; b=H5Qwn/LAlSgtYIsvDO4H6vUWwKAvAT6dnJ0cCagZEEQARYU7lH6hoE/YJlYKvKGo6f EoOuslaZ7jukfZdAArHze6DnlDaRROwcxcHGlOHqIQaFLP9/3wiGoTpvYCc8RuK8bMIa aIa6DHixmZqONg2zxZu2A0M3GRjHdVYsyb4qJGvnIuHbq9R83o5L51isLj0tqbS3FQ3Z lhVscsVkkeGXHcQctyRqibryUT2NLVyW7Ko3k24wA+VNkj5pJqqznKDrKVKiJChOLzwi 14ukSZ2KsGrtexj13mSc2IfmIVMoewE9p7Mns2x2XhXFY0OwQ6gyG4+1StEjmAm6nZm2 H+9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=eq1C0rjwFUYyMwsIFzYbf/pJTQXg8uiNJtZqpHjojA8=; fh=pnZF6rzA50VQ06Ks8UUSgsDCVUaPEFlTI8rdPUngd8k=; b=jF3mQibc3yKs2a+4tOHKVFEAUg1ZHyULoUouN/XYwCX/odsMOG9pXkXCsCah/a0OGQ bmvtkHLHSXfZS8QaS2ngNeApRHIs8AVhwpEBkPyNfkhcSKQhWD4D/MW2J1cxRuHiQNQy lahO3maV7RjnHq/BiszuI7iLpNJUAy0414p/q3P8R2/QpYsXsU3/KaNsOsonRBvY+OfB LvgHGmrR+17Pa0qVYKk3pOBXN5I6YdzHD1+znFEwdA8zXvs2e3lfl4DePaqnxSJbE3sf GOgxmL7NeG7EC563Nre64bHzgLC/zpJRXlpInTR/cLRasSb/AqrI6r0W5n4tOczuVGi/ tOmA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=renesas.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o62-20020a634141000000b0055c66f42ee3si7587311pga.533.2023.09.04.03.43.09; Mon, 04 Sep 2023 03:43:23 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=renesas.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236887AbjICL4C (ORCPT + 99 others); Sun, 3 Sep 2023 07:56:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230293AbjICL4C (ORCPT ); Sun, 3 Sep 2023 07:56:02 -0400 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6614F124; Sun, 3 Sep 2023 04:55:58 -0700 (PDT) X-IronPort-AV: E=Sophos;i="6.02,224,1688396400"; d="scan'208";a="174843004" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 03 Sep 2023 20:55:58 +0900 Received: from localhost.localdomain (unknown [10.226.92.30]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 566E141C2D8A; Sun, 3 Sep 2023 20:55:55 +0900 (JST) From: Biju Das To: Jonathan Cameron Cc: Biju Das , Lars-Peter Clausen , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Marek Vasut , Andy Shevchenko , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Biju Das Subject: [PATCH v3 1/4] iio: dac: mcp4725: Replace variable 'id' from struct mcp4725_data Date: Sun, 3 Sep 2023 12:55:45 +0100 Message-Id: <20230903115548.59306-2-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230903115548.59306-1-biju.das.jz@bp.renesas.com> References: <20230903115548.59306-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS 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 Replace the variable 'id' from struct mcp4725_data with local variable chip_id in probe() as the id variable is not used elsewhere in the driver. Signed-off-by: Biju Das --- v2->v3: * No change. v1->v2: * Update commit description with reason for change. --- drivers/iio/dac/mcp4725.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/iio/dac/mcp4725.c b/drivers/iio/dac/mcp4725.c index f4a3124d29f2..33a61f65bc25 100644 --- a/drivers/iio/dac/mcp4725.c +++ b/drivers/iio/dac/mcp4725.c @@ -32,7 +32,6 @@ struct mcp4725_data { struct i2c_client *client; - int id; unsigned ref_mode; bool vref_buffered; u16 dac_value; @@ -387,6 +386,7 @@ static int mcp4725_probe(struct i2c_client *client) struct mcp4725_data *data; struct iio_dev *indio_dev; struct mcp4725_platform_data *pdata, pdata_dt; + int chip_id; u8 inbuf[4]; u8 pd; u8 ref; @@ -399,9 +399,9 @@ static int mcp4725_probe(struct i2c_client *client) i2c_set_clientdata(client, indio_dev); data->client = client; if (dev_fwnode(&client->dev)) - data->id = (uintptr_t)device_get_match_data(&client->dev); + chip_id = (uintptr_t)device_get_match_data(&client->dev); else - data->id = id->driver_data; + chip_id = id->driver_data; pdata = dev_get_platdata(&client->dev); if (!pdata) { @@ -414,7 +414,7 @@ static int mcp4725_probe(struct i2c_client *client) pdata = &pdata_dt; } - if (data->id == MCP4725 && pdata->use_vref) { + if (chip_id == MCP4725 && pdata->use_vref) { dev_err(&client->dev, "external reference is unavailable on MCP4725"); return -EINVAL; @@ -455,12 +455,12 @@ static int mcp4725_probe(struct i2c_client *client) indio_dev->name = id->name; indio_dev->info = &mcp4725_info; - indio_dev->channels = &mcp472x_channel[id->driver_data]; + indio_dev->channels = &mcp472x_channel[chip_id]; indio_dev->num_channels = 1; indio_dev->modes = INDIO_DIRECT_MODE; /* read current DAC value and settings */ - err = i2c_master_recv(client, inbuf, data->id == MCP4725 ? 3 : 4); + err = i2c_master_recv(client, inbuf, chip_id == MCP4725 ? 3 : 4); if (err < 0) { dev_err(&client->dev, "failed to read DAC value"); @@ -470,10 +470,10 @@ static int mcp4725_probe(struct i2c_client *client) data->powerdown = pd > 0; data->powerdown_mode = pd ? pd - 1 : 2; /* largest resistor to gnd */ data->dac_value = (inbuf[1] << 4) | (inbuf[2] >> 4); - if (data->id == MCP4726) + if (chip_id == MCP4726) ref = (inbuf[3] >> 3) & 0x3; - if (data->id == MCP4726 && ref != data->ref_mode) { + if (chip_id == MCP4726 && ref != data->ref_mode) { dev_info(&client->dev, "voltage reference mode differs (conf: %u, eeprom: %u), setting %u", data->ref_mode, ref, data->ref_mode); -- 2.25.1