From nobody Mon Nov 25 05:35:05 2024 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 65C061EBFFB for ; Wed, 30 Oct 2024 13:44:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730295885; cv=none; b=WxGSbPD1VPdHBl++/Q7We4yHRDfOEfzkce8wep8a46FymqbpuRC9jj8tjANYSVG3UYBfDDi9jOgGsseGoPAHwa5Uj/tIE6Ws2YlF7vmnewf5SxlspwqrHct5A9aE2YOqPIn+PXFK7pVWXwneQvRrC48pk3C5Tlq7deRHZTeyLGM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730295885; c=relaxed/simple; bh=RO9hGOKZEvxMEHLVRYfaOYF08wLVGpI7aOsmLqLjRtM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=nB+9dcH7JF0MyN3Il+qRksUjsFixvUwiDb61B/7gEzlvDCZbpQQn9RPe2dbL0VMTDBrgEBUNs8GDPK04az6ihrXE/aOsRvK/qSXPy+bUsNDqV7sw3HUVsHOHqFjRxdNCHpPtqA+qgl8ZPYHPVTFjJGcqCb1becdn1UJ2dNWivZY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=bKJQAbIG; arc=none smtp.client-ip=209.85.128.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="bKJQAbIG" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-43158625112so64299285e9.3 for ; Wed, 30 Oct 2024 06:44:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1730295881; x=1730900681; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=8BjJ2M207dDw7Til612ivS6L47An/FajkZsL4QTnDEc=; b=bKJQAbIGjBPe4iS983eJ78eVNlPZltni+bIIZh6tMortUtEK0FOkkJI+RsNB2ZkJZj Gao0cmxA0wecIq3nXV4+JB0Amf1klyOlpxQCTRhNZ4od+U8If4+sPxv9USAtLvQ9ghuS WjS77wKgTP5XaRQgp3gfrvsjefStH1oTmfHshCgqT4UiPZZk8AerIFUbkBx4kIMGqpAM gPyKkSH5STYVraBBICcut3RdYiKvQxIlIGmi/sX7TgBbcz+ZkoeErnivj6y/N8hZqcfd RJ6nevKobTqikTAUme945dWGVdH/VI+Jrd5/yq5GgcxXv6fGDG86HE/qUtFvpScMn+xz Qb1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730295881; x=1730900681; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8BjJ2M207dDw7Til612ivS6L47An/FajkZsL4QTnDEc=; b=RPGVAuuAUDfZe2cjUT+PzAJ8PnGvLvaUt0D8O63Gxpk9T0BmExehmWWg9ggwzD5NZy /5GT2drJmu1d7pMu6Vkh2e7aP/pcx8pBgcfyQ5NycbPdRr9rV9nJbCdcARbpkZlLJMRx y6iqEH4Wlzn9TifqLPzlFj5lRCrqK3F6zHLYUN8FTyG6MY2CMa95ypOZ3QOAMJXuAySf qbZzwsUXCvnY41Wr418S4OrA4DF9aaEMczS+bzSdZEAPcyMokCdoD0bAQ67wqD7b4lTg SOa/fuhT0P1TP8sKPksewicVlBSHvuTwfDFaLd+6JvXyS+OHNS6kntuZMBpk8yuQX9dc 1JWQ== X-Forwarded-Encrypted: i=1; AJvYcCUnQ2D127Ipf54V4+V6mNLexvQMy+y9hdqLQwNtgpM7HESVw3XgGo28PHylvGSI1L5r1FHag0egVfG/UjE=@vger.kernel.org X-Gm-Message-State: AOJu0YwAyRd124fx38b8vvzEhhfhoyouynacsdXoIlMyl8WgRZ6BH4Ty adRJlOm9o8Iu0Zosd0u0uWq0wienXR3NH0ErlZEm8H6pleqWeEJikRLUSbc0zCo= X-Google-Smtp-Source: AGHT+IEqWScIHhC8tPglxlTqg9bpzau4UkxRE+2yBiH6NV8VeDBBJkoxE09TQc+ilKeht4wWRnPEFw== X-Received: by 2002:a05:600c:4711:b0:431:586e:7e7 with SMTP id 5b1f17b1804b1-4319ac6e818mr145719855e9.1.1730295880634; Wed, 30 Oct 2024 06:44:40 -0700 (PDT) Received: from [192.168.1.62] (2a02-842a-d52e-6101-6f8f-5617-c4b6-8627.rev.sfr.net. [2a02:842a:d52e:6101:6f8f:5617:c4b6:8627]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-431bd97d693sm22135175e9.24.2024.10.30.06.44.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Oct 2024 06:44:40 -0700 (PDT) From: Julien Stephan Date: Wed, 30 Oct 2024 14:44:27 +0100 Subject: [PATCH v4 3/5] iio: adc: ad7380: use local dev variable to shorten long lines Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241030-ad7380-add-adaq4380-4-support-v4-3-864ff02babae@baylibre.com> References: <20241030-ad7380-add-adaq4380-4-support-v4-0-864ff02babae@baylibre.com> In-Reply-To: <20241030-ad7380-add-adaq4380-4-support-v4-0-864ff02babae@baylibre.com> To: Lars-Peter Clausen , Michael Hennerich , =?utf-8?q?Nuno_S=C3=A1?= , David Lechner , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jonathan Corbet Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Julien Stephan X-Mailer: b4 0.14.2 Use local dev variable in the probe function to shorten long lines. Signed-off-by: Julien Stephan --- drivers/iio/adc/ad7380.c | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/drivers/iio/adc/ad7380.c b/drivers/iio/adc/ad7380.c index e5eececaaf501cda8f51d801c089e593111df714..206c894953f057acca20805fb30= 185cb7ab8a902 100644 --- a/drivers/iio/adc/ad7380.c +++ b/drivers/iio/adc/ad7380.c @@ -1035,12 +1035,13 @@ static int ad7380_init(struct ad7380_state *st, boo= l external_ref_en) =20 static int ad7380_probe(struct spi_device *spi) { + struct device *dev =3D &spi->dev; struct iio_dev *indio_dev; struct ad7380_state *st; bool external_ref_en; int ret, i; =20 - indio_dev =3D devm_iio_device_alloc(&spi->dev, sizeof(*st)); + indio_dev =3D devm_iio_device_alloc(dev, sizeof(*st)); if (!indio_dev) return -ENOMEM; =20 @@ -1048,21 +1049,20 @@ static int ad7380_probe(struct spi_device *spi) st->spi =3D spi; st->chip_info =3D spi_get_device_match_data(spi); if (!st->chip_info) - return dev_err_probe(&spi->dev, -EINVAL, "missing match data\n"); + return dev_err_probe(dev, -EINVAL, "missing match data\n"); =20 - ret =3D devm_regulator_bulk_get_enable(&spi->dev, st->chip_info->num_supp= lies, + ret =3D devm_regulator_bulk_get_enable(dev, st->chip_info->num_supplies, st->chip_info->supplies); =20 if (ret) - return dev_err_probe(&spi->dev, ret, + return dev_err_probe(dev, ret, "Failed to enable power supplies\n"); fsleep(T_POWERUP_US); =20 if (st->chip_info->external_ref_only) { - ret =3D devm_regulator_get_enable_read_voltage(&spi->dev, - "refin"); + ret =3D devm_regulator_get_enable_read_voltage(dev, "refin"); if (ret < 0) - return dev_err_probe(&spi->dev, ret, + return dev_err_probe(dev, ret, "Failed to get refin regulator\n"); =20 st->vref_mv =3D ret / 1000; @@ -1074,10 +1074,9 @@ static int ad7380_probe(struct spi_device *spi) * If there is no REFIO supply, then it means that we are using * the internal reference, otherwise REFIO is reference voltage. */ - ret =3D devm_regulator_get_enable_read_voltage(&spi->dev, - "refio"); + ret =3D devm_regulator_get_enable_read_voltage(dev, "refio"); if (ret < 0 && ret !=3D -ENODEV) - return dev_err_probe(&spi->dev, ret, + return dev_err_probe(dev, ret, "Failed to get refio regulator\n"); =20 external_ref_en =3D ret !=3D -ENODEV; @@ -1085,7 +1084,7 @@ static int ad7380_probe(struct spi_device *spi) } =20 if (st->chip_info->num_vcm_supplies > ARRAY_SIZE(st->vcm_mv)) - return dev_err_probe(&spi->dev, -EINVAL, + return dev_err_probe(dev, -EINVAL, "invalid number of VCM supplies\n"); =20 /* @@ -1095,18 +1094,18 @@ static int ad7380_probe(struct spi_device *spi) for (i =3D 0; i < st->chip_info->num_vcm_supplies; i++) { const char *vcm =3D st->chip_info->vcm_supplies[i]; =20 - ret =3D devm_regulator_get_enable_read_voltage(&spi->dev, vcm); + ret =3D devm_regulator_get_enable_read_voltage(dev, vcm); if (ret < 0) - return dev_err_probe(&spi->dev, ret, + return dev_err_probe(dev, ret, "Failed to get %s regulator\n", vcm); =20 st->vcm_mv[i] =3D ret / 1000; } =20 - st->regmap =3D devm_regmap_init(&spi->dev, NULL, st, &ad7380_regmap_confi= g); + st->regmap =3D devm_regmap_init(dev, NULL, st, &ad7380_regmap_config); if (IS_ERR(st->regmap)) - return dev_err_probe(&spi->dev, PTR_ERR(st->regmap), + return dev_err_probe(dev, PTR_ERR(st->regmap), "failed to allocate register map\n"); =20 /* @@ -1157,7 +1156,7 @@ static int ad7380_probe(struct spi_device *spi) indio_dev->modes =3D INDIO_DIRECT_MODE; indio_dev->available_scan_masks =3D st->chip_info->available_scan_masks; =20 - ret =3D devm_iio_triggered_buffer_setup(&spi->dev, indio_dev, + ret =3D devm_iio_triggered_buffer_setup(dev, indio_dev, iio_pollfunc_store_time, ad7380_trigger_handler, &ad7380_buffer_setup_ops); @@ -1168,7 +1167,7 @@ static int ad7380_probe(struct spi_device *spi) if (ret) return ret; =20 - return devm_iio_device_register(&spi->dev, indio_dev); + return devm_iio_device_register(dev, indio_dev); } =20 static const struct of_device_id ad7380_of_match_table[] =3D { --=20 2.47.0