From patchwork Mon Jun 14 11:35:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 459850 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp3201509jae; Mon, 14 Jun 2021 04:40:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyG/YF76mZVkGiTkkvoOLIBhLZQm6/y3vPlC/oHXn8TtM33Xwjd+l6qsvSXT/1hpnY7dsMC X-Received: by 2002:a05:6402:22fa:: with SMTP id dn26mr16122710edb.230.1623670825050; Mon, 14 Jun 2021 04:40:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623670825; cv=none; d=google.com; s=arc-20160816; b=umIE0eNqTNy2NbQR0CalIOaQvsUP4sGkJ3FcGqrwmm/3FjTsgOFaAKO11B+dY0LYv0 vJP7aGVKF69ijD7M6lqb92XYhMjQd2tOG+lMdVwKWx7zmQU4R0clZzzAPgntrsQdRg6V ntGXyU6/MngJSqc38m+ApKAsy+/ZA5kVqGkNht+k7CQpKuiV5YMgkGQOwAB81LVUHNRe pLs9ScimOFInt7pZyEfvjnWNwQA/oTvj57mRG8xydFugHFBlbXoGAiJHuRFlha8MzvmU W17yhygWowsrsqhc6A8o+Tz3Gvp/cPhKXNUdraCV3cdY89AKuIo3q3D1jUN1KcgNoIEc HyVA== 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 :dkim-signature; bh=4GRwoOoV8NAw9iUeYN3EET65xEcGJ3bPSvAFCPxLtI0=; b=kULzfE38Td1s7y3atdhE/HLlhev7EliRTXfmqfA94pFTXLyD8Y9SdQN2q1OIbL9jwI IeYsgnsSQBlLcfv/OyM3sTdoi4h7Gwsmx2vKes8b8+y+nvKzXZhmSGOfcHBbUuLde3Fq 3ZcPouRbqu+EX1Rc3JcbhKVc36RXN+03MbZqrC2waeYuVBD/dAihXtZ1lgHBFN8oRwhu xDJ6lx5umTsaoSfzf6sTqf3KzUYsphgbFOSsav6ESdQmgbnbmGHd68CW58DujgRKMAvJ pW98tdQerFjrY9Uh3+lhEj7jDgPJb58gzl2d/A/9PlzDm3CtX5y7lk14TDxlnr8gBKik SNpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uSDPCMMs; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nb10si11945869ejc.344.2021.06.14.04.40.24; Mon, 14 Jun 2021 04:40:25 -0700 (PDT) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uSDPCMMs; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235872AbhFNLlp (ORCPT + 7 others); Mon, 14 Jun 2021 07:41:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:59786 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234688AbhFNLhb (ORCPT ); Mon, 14 Jun 2021 07:37:31 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7400B613D3; Mon, 14 Jun 2021 11:33:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623670431; bh=DdhD+UYIptRwCAyJgGEgxEJPQ7/pKpn2YAzl6dapdBY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uSDPCMMsUOJx4CEI3SFkJHoGP8nI6Y/p06EvcRp4xKSADg9Dm7e1Z5cPbXmyn+MeC NOr2jD+vi/jkgl7kiOh6dsrmGN72NilxV7ZIVzzfZvNzGW5enYXDpT7lA5rAITqEiI xj9POHobUC/sKW9rkWAMT0RPbcsymVDmLai7IzTq05yFYKbyjvxD2Olmm4lnlrgJsg /u/AjcfAj7jAtBYY5hYJWj5G0zdIKLIKNS7Ih+uUxaQ17vKmHYctu5WXvB0Ebczdmy yWgMBEgjZYr0xsodzymmmfTY01XcOW1Wfux8EVbVw5dM4wnizOA00fXW2pIffw4T9B 6AmGfkc2AWcYg== From: Jonathan Cameron To: linux-iio@vger.kernel.org, Rob Herring Cc: Michael.Hennerich@analog.com, lars@metafoo.de, devicetree@vger.kernel.org, Nuno Sa , Jonathan Cameron Subject: [PATCH 13/17] staging:iio:adc:ad7280a: Use a local dev pointer to avoid &spi->dev Date: Mon, 14 Jun 2021 12:35:03 +0100 Message-Id: <20210614113507.897732-14-jic23@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210614113507.897732-1-jic23@kernel.org> References: <20210614113507.897732-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Jonathan Cameron We use this a few times already and it is about to get worse, so introduce a local variable to simplify things. Signed-off-by: Jonathan Cameron --- drivers/staging/iio/adc/ad7280a.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) -- 2.32.0 diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c index b4ba6da07af9..acaae1b33986 100644 --- a/drivers/staging/iio/adc/ad7280a.c +++ b/drivers/staging/iio/adc/ad7280a.c @@ -940,11 +940,12 @@ static const struct ad7280_platform_data ad7793_default_pdata = { static int ad7280_probe(struct spi_device *spi) { const struct ad7280_platform_data *pdata = dev_get_platdata(&spi->dev); + struct device *dev = &spi->dev; struct ad7280_state *st; int ret; struct iio_dev *indio_dev; - indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st)); + indio_dev = devm_iio_device_alloc(dev, sizeof(*st)); if (!indio_dev) return -ENOMEM; @@ -976,7 +977,7 @@ static int ad7280_probe(struct spi_device *spi) st->aux_threshhigh = 0xFF; st->acquisition_time = pdata->acquisition_time; - ret = devm_add_action_or_reset(&spi->dev, ad7280_sw_power_down, st); + ret = devm_add_action_or_reset(dev, ad7280_sw_power_down, st); if (ret) return ret; @@ -1005,7 +1006,7 @@ static int ad7280_probe(struct spi_device *spi) if (ret) return ret; - ret = devm_request_threaded_irq(&spi->dev, spi->irq, + ret = devm_request_threaded_irq(dev, spi->irq, NULL, ad7280_event_handler, IRQF_TRIGGER_FALLING | @@ -1020,7 +1021,7 @@ static int ad7280_probe(struct spi_device *spi) indio_dev->info = &ad7280_info_no_irq; } - return devm_iio_device_register(&spi->dev, indio_dev); + return devm_iio_device_register(dev, indio_dev); } static const struct spi_device_id ad7280_id[] = {