Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2555897rwb; Mon, 3 Oct 2022 02:29:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4Xl/EVdOLJARC+EnJ/181c630iwiwegvqM2Kp48j6Ry2pTmcUnhJtNA/0/ffLbTeUHX4rR X-Received: by 2002:a05:6402:5162:b0:457:6ef2:df3 with SMTP id d2-20020a056402516200b004576ef20df3mr17753658ede.128.1664789395337; Mon, 03 Oct 2022 02:29:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664789395; cv=none; d=google.com; s=arc-20160816; b=rzoLP1z4i0RUelw9Z6FukCwmLOrXlviLie0ra2d8m/y4XYc20MI6qXWUzacqlvULYF /0UNlCrjGvH5Wh/OsnpmdkeiXCZ07o5LQbHSA/JfXWL8pMW5k/Reum6z+At30cUGIXSG U1OQJ471R64CMFkDnQJ9L1miHI7KFAJ00wv0vx7pzAUEUndzWUSgN1g4H2ojnXQfzSH+ DTKEZFuxFQsN4pVE5XvHv6J7ErtdLZ78h/9zPI6mxY3/X8134nkoxwqvfJmov4aYlvCd 3xQCEFaZliRag+51wH/ai+dpgrsqgg3NG3vK47iL9MuUIJ+smpPcnWVHhUVjUCngwaq2 LIhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ozJi7bas0K7OL0m/OlaE7Db/H8qeB+9gBWikgiBjNdA=; b=L04gag+tDowTlJWMjQGJhyRzmhtcw+nGkKHCe7AVOdk8WuVAgLYH71eu6LiJyCbNd+ 4Lg0afZKjxsYkLq5ZMGgBKuADoLuN4wVd8yPbTIcRYITA9GLhazGOhme1i52mTgozPzd v9Mh+Epygudz0qMz7KspPWUkMW0svmVdvxhnrhjs2TFaiIaViKSAZv+cQoZaYrqv/Yzg SQKkzH50ethglSz88hHx5954ahD2mixf2aXaAzYWXEmy/rsDialhfgRyNyPZSS8H5/h2 rxFK5azMWemT01GN1z3nF5eVlgPp5OMGXUqvxmGAyobAajT24M4uqPa4tAFWSr+WYeFM yLrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=AY3EwZCk; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s4-20020a17090699c400b0077f2779c178si4373454ejn.254.2022.10.03.02.29.29; Mon, 03 Oct 2022 02:29:55 -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=@gmail.com header.s=20210112 header.b=AY3EwZCk; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231197AbiJCIjs (ORCPT + 99 others); Mon, 3 Oct 2022 04:39:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231393AbiJCIjD (ORCPT ); Mon, 3 Oct 2022 04:39:03 -0400 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88C594B98B; Mon, 3 Oct 2022 01:13:38 -0700 (PDT) Received: by mail-lj1-x22c.google.com with SMTP id l14so819072lja.8; Mon, 03 Oct 2022 01:13:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=ozJi7bas0K7OL0m/OlaE7Db/H8qeB+9gBWikgiBjNdA=; b=AY3EwZCkUfoCgnmJKPHFE/JaPiyO4ZsN2ZD1VaZZ8NACu+v0YePbkc4falbnv23QtE zsFDgeGk/L7z0oEuC6SkJUr4OfNzt6K0Lt4bGALj6WsqeeVaFK5XC4jcWW2RXRse9mqZ RZHaeth/4DyJeSZktk/RLOoogCe7kLchTDUIAiTc/jr8I+Y+56ybzZET4lz9FL2cquZC MN7BwPqeIZJhOfJVptdX7EeA+nDTlDR6HhEvHlNC2s5HMiycoJ8oAIm8NCg5oLkD71dl 3xKfUWGZmk0P/YO3b9T1SXuL+8BISEZy2VJj9e2vLbjtUgmbFGpEbBnYA9L58ZB9kzYG JM+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=ozJi7bas0K7OL0m/OlaE7Db/H8qeB+9gBWikgiBjNdA=; b=RhNb3myUOyGwGG/ZqakV2vtLE5Bo2tt0T21g/cteCM7YGbik4cULLsT3Xia6PyM1Ny SVzUPT7IDYwHT4JcknSq0lo4l/V5wr8xanjXbam/zMhkr9p+k4P0jx1xQarQh9IrzElo LNjNw1exiHC7X6IQtcsDyc1AmZHE8rs9Jvi2DT02sp/YnAZiSB+rbS6CjKZVR69uuPlX gdBT6x9LwFfjeTOrIYlefNprUmY5fOB7idMn+qNEEuvadMH6q/DtIbibd8TzyjdPxad9 b7Gy9usKd7+tXQaSG3spMFJhK36tWXjrrgZyXukvbbqDz7eerP/3owokeyQTbqfWzCAF HqQQ== X-Gm-Message-State: ACrzQf2q5pQn+2EcNSf3YEx6gi1rnVGUapw7RXzBb0S2ym0T1JIA8DFk vyb4twPDZo+I5yu0urTE8eQ= X-Received: by 2002:a05:651c:1a26:b0:26c:4c0d:b10a with SMTP id by38-20020a05651c1a2600b0026c4c0db10amr5760102ljb.415.1664784816913; Mon, 03 Oct 2022 01:13:36 -0700 (PDT) Received: from dc75zzyyyyyyyyyyyyyyt-3.rev.dnainternet.fi (dc75zzyyyyyyyyyyyyyyt-3.rev.dnainternet.fi. [2001:14ba:16f3:4a00::1]) by smtp.gmail.com with ESMTPSA id m1-20020a2ea881000000b0026c423959desm822084ljq.25.2022.10.03.01.13.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Oct 2022 01:13:36 -0700 (PDT) Date: Mon, 3 Oct 2022 11:13:31 +0300 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Eugen Hristev , Jonathan Cameron , Lars-Peter Clausen , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , linux-iio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 09/10] iio: at91-sama5d2_adc: Use IIO_STATIC_CONST_DEVICE_ATTR() Message-ID: <4476a4ce852febb3eb863878e66751c787195b18.1664782676.git.mazziesaccount@gmail.com> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="0RceFZoSIZYBk5np" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 --0RceFZoSIZYBk5np Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Slightly simplify by dropping open-coded constant data iio_dev_attr functions and using the IIO_STATIC_CONST_DEVICE_ATTR() instead. Signed-off-by: Matti Vaittinen --- drivers/iio/adc/at91-sama5d2_adc.c | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sama= 5d2_adc.c index 6e3f9fa93cee..dca014d1108f 100644 --- a/drivers/iio/adc/at91-sama5d2_adc.c +++ b/drivers/iio/adc/at91-sama5d2_adc.c @@ -1841,26 +1841,13 @@ static ssize_t at91_adc_get_watermark(struct device= *dev, return scnprintf(buf, PAGE_SIZE, "%d\n", st->dma_st.watermark); } =20 -static ssize_t hwfifo_watermark_min_show(struct device *dev, - struct device_attribute *attr, - char *buf) -{ - return sysfs_emit(buf, "%s\n", "2"); -} - -static ssize_t hwfifo_watermark_max_show(struct device *dev, - struct device_attribute *attr, - char *buf) -{ - return sysfs_emit(buf, "%s\n", AT91_HWFIFO_MAX_SIZE_STR); -} - static IIO_DEVICE_ATTR(hwfifo_enabled, 0444, at91_adc_get_fifo_state, NULL, 0); static IIO_DEVICE_ATTR(hwfifo_watermark, 0444, at91_adc_get_watermark, NULL, 0); -static IIO_DEVICE_ATTR_RO(hwfifo_watermark_min, 0); -static IIO_DEVICE_ATTR_RO(hwfifo_watermark_max, 0); + +IIO_STATIC_CONST_DEVICE_ATTR(hwfifo_watermark_min, "2"); +IIO_STATIC_CONST_DEVICE_ATTR(hwfifo_watermark_max, AT91_HWFIFO_MAX_SIZE_ST= R); =20 static IIO_CONST_ATTR(oversampling_ratio_available, __stringify(AT91_OSR_1SAMPLES) " " --=20 2.37.3 --=20 Matti Vaittinen, Linux device drivers ROHM Semiconductors, Finland SWDC Kiviharjunlenkki 1E 90220 OULU FINLAND ~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~ Simon says - in Latin please. ~~~ "non cogito me" dixit Rene Descarte, deinde evanescavit ~~~ Thanks to Simon Glass for the translation =3D]=20 --0RceFZoSIZYBk5np Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEIx+f8wZb28fLKEhTeFA3/03aocUFAmM6masACgkQeFA3/03a ocVFOwf+MOBner9amlp7MwwSXLM4mws2DdggLA9dDw0SC5bYjryERfkpQDydgffq U2IjQXossv6RH9CKuiFrZsB4YIA4B6RgapZlw0diTbYv5r7hLi17NGaBLx3pJ8E6 aC5FIwrSLl0+odcrtDpvSr4N8o7mSZoOmQG03yqU5K58v7Q6ft/0p+jWGDLJFMSq Pa97L8d79vEQ6pvRZnEOO3DpcxgyUuz4ONR4VTkYwxV6RRVq46fs7DaNCc97K3MN KN1Pzdzmt2yOZu6Ix4GvaCd6ZNgWrqNfSiFHZND07SKWcrP1f46Qa1vQgUyXDGF0 yY1LVUCRfCajBKzT2NIJDI9UMgIXWA== =fxgo -----END PGP SIGNATURE----- --0RceFZoSIZYBk5np--