From patchwork Thu Feb 6 22:48:15 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lechner X-Patchwork-Id: 13963968 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 40733C02194 for ; Thu, 6 Feb 2025 22:48:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=51BiJfVIT3zxjS3+7073ofoWfVTYCxPwRgt9LfpPsak=; b=3JVoxuNNxHpITK dNUQkQlVfgQFRQr6SMoIE4tOMJ0CVvwvlNMezhq/ghQds41T9/l8zAV948+YJ6DuVh4HjiKDosRh9 cKWV3Wtp2UdQ+WPEpBTdUXlBYeKzyXNgG7vO2iijk5HrAzrauvZTRe8Sspxb2k/62DeaiX8Av3Lue tQlng6zkjPx/QCUa14YTlXrGcudoFghYWykWGIfqURv51mS0Fk+oYdmvidT4+CaNL4HizAsxdYp1i VFUxFHW8XPh0XH5HyNjIzP6LUq0JiMdNKADELq5zJDjtOifGKfmnmJ5GNBUeyq/YunW93+c9nm4or mPabtGQU2Gas7U+frNTg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tgAfZ-00000007iId-32Rw; Thu, 06 Feb 2025 22:48:25 +0000 Received: from mail-ot1-x332.google.com ([2607:f8b0:4864:20::332]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tgAfX-00000007iI7-0iaR for linux-phy@lists.infradead.org; Thu, 06 Feb 2025 22:48:24 +0000 Received: by mail-ot1-x332.google.com with SMTP id 46e09a7af769-71fbb0d035dso905091a34.2 for ; Thu, 06 Feb 2025 14:48:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1738882102; x=1739486902; darn=lists.infradead.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=kXql2LNKpg2iJS7/BXdVqEWK4gXiK1Iis7jUGxkm/8M=; b=pHlMKthHDM1GTTzl2C3uqjIxRvNgT2hxO8yq0iT2LihyUTDI3StKAzjC+blDdNKEfZ 2Q6C/kjvyMM0arlwllj14s6xpCmT3teLv4EM1/JQRnjylU87o2JhjkCUyDVa0GDsjzak GQRgaSkMMLD7qUEKuxcwmp4fuA9/KCZDsIctRnfpsrrh4ew2CRBgEeXSRVfspMogcKAW Kd3ps7Ehe/tsNGOGXnajedzh4lE8noXYkNN/yNnA9DM5SCjmRtVipMX1m5SCyTA1saym ErbFrzKd3HMGDu4hW8YivS5XKv6Hx8dpOGoRdtXojKtVHgBdOUuvXRC2AwEEJoyW62K2 pHXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738882102; x=1739486902; 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=kXql2LNKpg2iJS7/BXdVqEWK4gXiK1Iis7jUGxkm/8M=; b=Io2WA3gpEawxe0sI1V+5ktuDDgqP+nOpI6wk3imcu7cb+XYNOnLi0PrdImVoqmTwIK NZ8R8srPw+TzUwmVyxTkI9ZBXMG4iBbpOXOqDGO0gBoipZJMzGX/axIeJ+5id6+wGBEm 43V3uKNDB9Id6/SEbxY1rVnSu8keJH0MUeQjjgZ53N8QkfEGhpA19uZtAPXL1VQMHUsa 6hwVLXHAW6mX5FsNo30kbnY6bE3yw6hgENZNCfTrlG8wvpTNPcst6dvWTuHpVAYkjKwI WJFnJujPa0RqdR74SkYdCoAGBqEP+sW4I0b4SHxHSL5bIKvzcmelHF8oiyQOzAEIbbkp w2RQ== X-Forwarded-Encrypted: i=1; AJvYcCUQ8jrdK2dOX42ZWQa+khXx4EhO9FLPTj92UDzP0899+fqZ4+7SS++Cjzn8Y9pH0mLN3Vd+gsXwgws=@lists.infradead.org X-Gm-Message-State: AOJu0Yw/QZ4KsSe1O2YIJjj+m+h6VI6N7eIwcngczxC0MAFw6nwtjwLM yPKXjXYkgoy4P3z6sjQ5PihczvKnC2khxc1lQy2O0R83V3m/aycbqZ5xDFFxtEk= X-Gm-Gg: ASbGncsFg00ZCp520mj4/gEltGjYkXdvRQ+w/eKsuFiIUztMzP7lIheigBPLEBH5yZU WmBDlL4Uo/ugeLmMiJMqJAeelxSoMQvDan3DWBAtu5qqUQzAaJPIpmp4zSSuMN/pT1SACCMFtNO d6NpuaVMUd9QpkjTpYwqmdfRtMT+jHeOrGh/Vme/Ve0RJyRhI2Fx+S1SEhSBBJ/OYR0NU3UxnB0 6uWFRC2WpftxDJoJQ/RfgGg9sErgnUf1s2ycQR/mhMEtf/C7HE4kxQVryPx0C/VUTaDc+8VOGD3 fTraGRq5ws+mwtm31qHNglS1/1lS3LlGsdWoumMWuCe90+I= X-Google-Smtp-Source: AGHT+IFiFjinAKAnXyIV7RGC3+Xe5Ny6G8kVNZ77hCnDk++KNDJly3JOvlipHi0kVubWlIsfK4Ezzw== X-Received: by 2002:a05:6830:6e0b:b0:71e:5a:f4f4 with SMTP id 46e09a7af769-726b88b89cemr713244a34.25.1738882102556; Thu, 06 Feb 2025 14:48:22 -0800 (PST) Received: from [127.0.1.1] (ip98-183-112-25.ok.ok.cox.net. [98.183.112.25]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-726af95bbb5sm510986a34.41.2025.02.06.14.48.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2025 14:48:22 -0800 (PST) From: David Lechner Date: Thu, 06 Feb 2025 16:48:15 -0600 Subject: [PATCH v2 01/13] gpiolib: add gpiod_multi_set_value_cansleep() MIME-Version: 1.0 Message-Id: <20250206-gpio-set-array-helper-v2-1-1c5f048f79c3@baylibre.com> References: <20250206-gpio-set-array-helper-v2-0-1c5f048f79c3@baylibre.com> In-Reply-To: <20250206-gpio-set-array-helper-v2-0-1c5f048f79c3@baylibre.com> To: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Geert Uytterhoeven , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Ulf Hansson , Peter Rosin , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Vinod Koul , Kishon Vijay Abraham I , =?utf-8?q?Nuno_S=C3=A1?= , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, linux-mmc@vger.kernel.org, netdev@vger.kernel.org, linux-phy@lists.infradead.org, linux-sound@vger.kernel.org, David Lechner X-Mailer: b4 0.14.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250206_144823_214954_AF43E53C X-CRM114-Status: GOOD ( 11.05 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org Add a new gpiod_multi_set_value_cansleep() helper function with fewer parameters than gpiod_set_array_value_cansleep(). Calling gpiod_set_array_value_cansleep() can get quite verbose. In many cases, the first arguments all come from the same struct gpio_descs, so having a separate function where we can just pass that cuts down on the boilerplate. Reviewed-by: Linus Walleij Signed-off-by: David Lechner --- include/linux/gpio/consumer.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h index db2dfbae8edbd12059826183b1c0f73c7a58ff40..278a197a9deba11dadbff0b58507df91be658f34 100644 --- a/include/linux/gpio/consumer.h +++ b/include/linux/gpio/consumer.h @@ -655,4 +655,11 @@ static inline void gpiod_unexport(struct gpio_desc *desc) #endif /* CONFIG_GPIOLIB && CONFIG_GPIO_SYSFS */ +static inline int gpiod_multi_set_value_cansleep(struct gpio_descs *descs, + unsigned long *value_bitmap) +{ + return gpiod_set_array_value_cansleep(descs->ndescs, descs->desc, + descs->info, value_bitmap); +} + #endif From patchwork Thu Feb 6 22:48:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lechner X-Patchwork-Id: 13963970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7596DC0219B for ; Thu, 6 Feb 2025 22:48:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7QH4x+K5Tw92siKG8R/o7ltC5kAN+Yd004yho3m7a9c=; b=MFVO6ghuWvPuM5 SF7oT4trIhZWKVIh4MY+UOlVC/ehUFT8G2xUrsiPOkJife49uc1mFsrzNgoXGaA3MPnSvNOAAwcTM Jibx97rzl2wQrAl5rMt7/B80cuiSeorJTj7o+52ajwp4m2qV5lgB3uf71fjIBuVvjoxqVDB5/tG7h BuH7p14LPD4F5VFGG3TLmphJAMw9Gf7kRMXgX2rGX0zWwTLQlcy9nQob0yhZeaMPdBCCOlMRG05AY FLdWs2fXkzDUA1Amxlt73CpkWSmxhCPNprQ7jguCRESHJA2hDBN7GBJSpdJAXkzPbNXlOekylRpPc BaS0W2wHh3Uj0xc878Ow==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tgAfb-00000007iJn-1028; Thu, 06 Feb 2025 22:48:27 +0000 Received: from mail-ot1-x32d.google.com ([2607:f8b0:4864:20::32d]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tgAfZ-00000007iIc-2dfA for linux-phy@lists.infradead.org; Thu, 06 Feb 2025 22:48:26 +0000 Received: by mail-ot1-x32d.google.com with SMTP id 46e09a7af769-71e287897ceso1142106a34.0 for ; Thu, 06 Feb 2025 14:48:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1738882104; x=1739486904; darn=lists.infradead.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=GH3NKtPpRHESHp33nulC7OX1rB6L2Ayb/Aiy8rtkYPA=; b=tBsmj6+2+D1ykcLTZ8C9PDNK3YK8EWI5k3CqNqk1d5wsFniTgkfUxu1teE7JaEVgSq 9QeXjxpLRxsHgQ0n7tKSPE9CoSWHPzVnnD2QA8qkGO3zbHVqa6vdfzlEGL0t6qFsB3LT 0TDCGl5MXwy6pdD/8Xy1laplDwMDY+oW4Y7Np3nQm0QhizDfBioSEh/k2MchiDO7xvjN fwB7myHX8FXj/0PCT61nzw+RdSbqh7Q1zPX7qEmfIrHIuMPcl2p7WICKbuphj2IcuM6d kDcGsH82kQM13gzN9HCZCbM3OBGGZbgdRVgF8r8bcS/z/nwBubHcdD/TQ+t8lxISf0Og NPiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738882104; x=1739486904; 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=GH3NKtPpRHESHp33nulC7OX1rB6L2Ayb/Aiy8rtkYPA=; b=EGBZOExaDWOwV6gXuY99uGcsIZ0CDpM61kzwEOhH4f0t1LXMr9t/u5I2+F6cD5xJOF K2ku0k6nKgv64Pra+/UemRdVwjJVAsFdlfG2VWLuAX0+gJ0jWh9GKfZkYqvDUiY/2eLr 5VwWkwmwEMNcnLq8gtHJgD0IcGEjobah/57GaCrrr12GbiKPLXPH1LgMPbhu2Si+OCLG 4l7K4QbhSNA9XiLYBDB9UV+LmwxxlIr1L7D7glnY7X184U5NLrinxqGyOslil/fopDHo qHEaMAiwStpls4rq9nzaLBPyGUQNuw+CYAG4HzBsHrtOteDLsqdyM4TbThlKVMiXTgd8 pDGA== X-Forwarded-Encrypted: i=1; AJvYcCX3eRZd4S4O+QL9vD+u/sqcNiSynyY1DxT/cDjqZxq3UGoaIm7WRk5NkEpGAREqZHu6nJw6cvJP7rs=@lists.infradead.org X-Gm-Message-State: AOJu0YzaAX1V/C5sveb46T9SBAnB+71ydyA+omyNhmVk37QV/6jxUZtx vbuKtEdUzXoz7EdNhhVif7Z/tcQ4dUDvE1sTLAjN9/z2Bfuat+cIsGsx457akPI= X-Gm-Gg: ASbGncukUu3anBBw0xDfEUL5YBPdHnwAmmeSiHSKPPRpDAoQoQz51rT1RUO+gC4CJtG Rfsl4Fgr7HJ9HSBjicQx2rdigbsZNj9n2w6/Wfu2h0WMSgqfmJIJczbHQHThA4bDK2l49A3/VwR qxpI3Q9ebXs/Rtil3oV/y+NNvc9rd++AA5JU7kufzIQrQ6W9ZnOfvFXwjQbt0J98SYabiNx+Mff uYM7FeaXrR1wHlItcO+L7+Ud2ayjjROYwsFjuMcFXjxY3pFVcbf0PMkP47Fk6oli2Ubw1JIcatz Kl9zrSywo0yw3LAauCcRmw/0FUk434QtbK43n30ZPdIOtXE= X-Google-Smtp-Source: AGHT+IHCjAZ/4mXxk1VXEbjQMmNTdXsRhhKdUtPACGbfwSRhNyt4nhKE9d5n5z8psMK5DgXY9qctNA== X-Received: by 2002:a05:6830:6c18:b0:71d:fb64:b601 with SMTP id 46e09a7af769-726b88c7282mr749926a34.27.1738882104636; Thu, 06 Feb 2025 14:48:24 -0800 (PST) Received: from [127.0.1.1] (ip98-183-112-25.ok.ok.cox.net. [98.183.112.25]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-726af95bbb5sm510986a34.41.2025.02.06.14.48.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2025 14:48:24 -0800 (PST) From: David Lechner Date: Thu, 06 Feb 2025 16:48:16 -0600 Subject: [PATCH v2 02/13] auxdisplay: seg-led-gpio: use gpiod_multi_set_value_cansleep MIME-Version: 1.0 Message-Id: <20250206-gpio-set-array-helper-v2-2-1c5f048f79c3@baylibre.com> References: <20250206-gpio-set-array-helper-v2-0-1c5f048f79c3@baylibre.com> In-Reply-To: <20250206-gpio-set-array-helper-v2-0-1c5f048f79c3@baylibre.com> To: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Geert Uytterhoeven , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Ulf Hansson , Peter Rosin , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Vinod Koul , Kishon Vijay Abraham I , =?utf-8?q?Nuno_S=C3=A1?= , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, linux-mmc@vger.kernel.org, netdev@vger.kernel.org, linux-phy@lists.infradead.org, linux-sound@vger.kernel.org, David Lechner X-Mailer: b4 0.14.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250206_144825_672033_208AFC03 X-CRM114-Status: GOOD ( 10.75 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org Reduce verbosity by using gpiod_multi_set_value_cansleep() instead of gpiod_set_array_value_cansleep(). Acked-by: Andy Shevchenko Reviewed-by: Linus Walleij Signed-off-by: David Lechner Reviewed-by: Geert Uytterhoeven --- drivers/auxdisplay/seg-led-gpio.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/auxdisplay/seg-led-gpio.c b/drivers/auxdisplay/seg-led-gpio.c index f10c25e6bf126cfaac3e4c353f8bfc6639d94a60..dfb62e9ce9b407fe356c3a7d2d25319b91a11a75 100644 --- a/drivers/auxdisplay/seg-led-gpio.c +++ b/drivers/auxdisplay/seg-led-gpio.c @@ -36,8 +36,7 @@ static void seg_led_update(struct work_struct *work) bitmap_set_value8(values, map_to_seg7(&map->map.seg7, linedisp->buf[0]), 0); - gpiod_set_array_value_cansleep(priv->segment_gpios->ndescs, priv->segment_gpios->desc, - priv->segment_gpios->info, values); + gpiod_multi_set_value_cansleep(priv->segment_gpios, values); } static int seg_led_linedisp_get_map_type(struct linedisp *linedisp) From patchwork Thu Feb 6 22:48:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lechner X-Patchwork-Id: 13963971 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BE2C8C02196 for ; Thu, 6 Feb 2025 22:48:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jQ7iqIk+fniulshAjGckHGzsHnSk+9Cy8L+cxrN/WlA=; b=1NaeBVvoFkwIby YWyHdImcR+8KqawHlCGreEHLNtan62YEsOfFPAhokqwU64jsF/l/1nfGvyRuCrlh7TsbZ5Nz7hj53 eekzI24JTCQtwQ+XcTcbDJ8ro56E+DJldh1eTNP3ncbGNXSxNA8rEERBrCg5OlOULEaADfFl/M6i/ z4khn7qPc+VyNFlIMcuIYEYwQA+ZUDakd/b9N9f4AIaah1BasKqCrCPf6Jv/i9FCM7xOlYrDUnIHc T4L+l3DJ68RV+nCiOHoSKpX8ppq7G+ihcbxD1LA8/VMRC/PxMMZrD9we2tg8b30Lq4Km1esnthe1o ZsKHq/AEbGEDww8VIBcA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tgAfd-00000007iKo-28qY; Thu, 06 Feb 2025 22:48:29 +0000 Received: from mail-ot1-x32c.google.com ([2607:f8b0:4864:20::32c]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tgAfa-00000007iJF-3BFa for linux-phy@lists.infradead.org; Thu, 06 Feb 2025 22:48:27 +0000 Received: by mail-ot1-x32c.google.com with SMTP id 46e09a7af769-71e2764aa46so1038575a34.2 for ; Thu, 06 Feb 2025 14:48:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1738882106; x=1739486906; darn=lists.infradead.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=dI+YClki4Q+OM8j5JXLpkAENpDyF7Cb60VCru1h+I9Y=; b=mJ6Phc+I8yxR9wcoq3tdsPEGPWrkSdGwFGG6jGeDuKYJJnAckmnzT564DHFrYo2y8W 6WwzV+tZU7eG9c7Admxr/R1vl5kQ2+/SZZ6d8dXUMIJpXirr/ZfmtorNxBDHqnCAAkUL kQuJzkGvv/1xQTdYMhgfpxBnxnT9D90Qb91sQkEj3+SnN2nBbVJqdgEZkbwv20eCUcDQ z6nb23L92wXk8MkwI/JnrWRK7CsB37+Sdv1Bbhg1KxUzVWIDt3jJYbOrY2aivSAabR4A siUAliA5KdYxK6wRWwNL6e1kpmpxO5onqGzNDWvUaSOt8+iYMqXJDKhCUI4ac1Q476vU //fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738882106; x=1739486906; 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=dI+YClki4Q+OM8j5JXLpkAENpDyF7Cb60VCru1h+I9Y=; b=Jmwt8mSwD0ykExzfXad9NOunT/dLWqM4Xx3+GPy2Fj3g/r/h/yoV5+Rhw99QzDAByS y8VmFJXtlaPvhkCqBlAYc5dlQLUuCrdVZyWb0fzZOsgcml9Wmbwg/RUZBTrX6M4I5SVM 8/dH00DMKhFg3hUsXS1hMZNG09uYGMCkO9Y33Urt9ralMdkM4mwisQ0Tbvl+zSwVCfku SAu+/2NtWR3YGNghzHEnXKX/z+xNS1T54rgJDR/fkGVIlslWwxO0J1gkMKFKxmgoM+ku 6dxwNug8/zb4L/aun3jjE3ARORcUF/4j6zi7TaSj6eoURFdWY6lG8uXFGcS+PX/zvyWA bOuA== X-Forwarded-Encrypted: i=1; AJvYcCW/eOepcXnXQ2b7zVSBPYBgC7cbrz9NK7lvQ+rwTn9q2wMzbjjT+lJMhrkh3rS4JtNf+NXsbgyWljk=@lists.infradead.org X-Gm-Message-State: AOJu0Yy6EWbKXIZFhgSsvZnNexKWzV6DwfAgp41Y67NBHEU7phEtrWTA KppLHai01HclDygHFR4+RLe9XPywUBoyi3l8M+Y5+STc81xElwfyIge+DRHrWXA= X-Gm-Gg: ASbGncvTrXqlK8/qWxjyypeca9TKfmfnPrZ46t2i9MQUE/hpkmFRmiwkftt/IP0pJq2 msrKT+wwWkrghbdaGKk0t6NMPgN98RY9+N+RozC7S0hKcuwWr81m0UUKG3raa8TBBbkueVMSYVr KFYHJW7BIgGsmI/CpJORHdeA4hCsE0KpB9ovJr5SV5tr4qwSavQ61ywcYgCp7ApPbFWDk4pbkfs urwKvHkL3BTQF1z20AAdLjuNstWGl4krAARVdhY0B7wVctHrCU2rr2XQPVdBdbVgjz8me/NsEyx /IFTY7ylG6IJowPoOyoJyWtFr50otRQDstKipcAZKUqyGOM= X-Google-Smtp-Source: AGHT+IGju4AgrFHpgx+WkS4zNBcn38CgmaIyeMDkbsnAb4rmy84NG+uCyuhvFXnSaOB2zZt+BWiqyg== X-Received: by 2002:a05:6830:6e03:b0:71d:63fc:2ea6 with SMTP id 46e09a7af769-726b87db6c0mr918380a34.8.1738882105791; Thu, 06 Feb 2025 14:48:25 -0800 (PST) Received: from [127.0.1.1] (ip98-183-112-25.ok.ok.cox.net. [98.183.112.25]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-726af95bbb5sm510986a34.41.2025.02.06.14.48.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2025 14:48:25 -0800 (PST) From: David Lechner Date: Thu, 06 Feb 2025 16:48:17 -0600 Subject: [PATCH v2 03/13] bus: ts-nbus: validate ts,data-gpios array size MIME-Version: 1.0 Message-Id: <20250206-gpio-set-array-helper-v2-3-1c5f048f79c3@baylibre.com> References: <20250206-gpio-set-array-helper-v2-0-1c5f048f79c3@baylibre.com> In-Reply-To: <20250206-gpio-set-array-helper-v2-0-1c5f048f79c3@baylibre.com> To: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Geert Uytterhoeven , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Ulf Hansson , Peter Rosin , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Vinod Koul , Kishon Vijay Abraham I , =?utf-8?q?Nuno_S=C3=A1?= , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, linux-mmc@vger.kernel.org, netdev@vger.kernel.org, linux-phy@lists.infradead.org, linux-sound@vger.kernel.org, David Lechner X-Mailer: b4 0.14.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250206_144826_799525_4F27E4CA X-CRM114-Status: GOOD ( 12.53 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org Add validation of ts,data-gpios array size during probe. The driver later hard-codes 8 as the size of the array when using it, so we should be validating that the array is actually that big to prevent possible out of bounds accesses. Reviewed-by: Linus Walleij Signed-off-by: David Lechner --- drivers/bus/ts-nbus.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/bus/ts-nbus.c b/drivers/bus/ts-nbus.c index 2328c48b9b1260e805c631f2aa7379d620084537..d3ee102a13893c83c50e41f7298821f4d7ae3487 100644 --- a/drivers/bus/ts-nbus.c +++ b/drivers/bus/ts-nbus.c @@ -48,6 +48,10 @@ static int ts_nbus_init_pdata(struct platform_device *pdev, return dev_err_probe(&pdev->dev, PTR_ERR(ts_nbus->data), "failed to retrieve ts,data-gpio from dts\n"); + if (ts_nbus->data->ndescs != 8) + return dev_err_probe(&pdev->dev, -EINVAL, + "invalid number of ts,data-gpios\n"); + ts_nbus->csn = devm_gpiod_get(&pdev->dev, "ts,csn", GPIOD_OUT_HIGH); if (IS_ERR(ts_nbus->csn)) return dev_err_probe(&pdev->dev, PTR_ERR(ts_nbus->csn), From patchwork Thu Feb 6 22:48:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lechner X-Patchwork-Id: 13963973 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 94B86C02194 for ; Thu, 6 Feb 2025 22:48:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QhGyYlyJFHPBMAtEONy4IAmtd0xYnk+nRHIVISMuykM=; b=1DEObVW8idNS+7 mTy++ZM8idzdIVcFzZt6c9bNHG8U3pYIIa/dBBMDU/7hU5HGBfm5FX08HlTqAqv9TYiG43SAGv5J6 WvkzG2SDjx+ubLtY/OVO0emhL0XQfpU+H7ioUsM1IR8zzhTxG55bmxkemeWoEZuT+anH6k2Rl8K98 n1LFcVj3nYFK565LWuNm/SIXcLJTGSM0ufHfT9+RvCeGU4QkxSlUyxq0dkEWFK7vmM5l5v0xAgm+B +s31ZZc2/73wPXwqDiPM6+E92yUx9wUgiv1HTFkFkEvROC5WKOH0DtKhrjjLG+UsXV6cYircFOi7+ YBVNAlcLqtKygLy0alvQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tgAff-00000007iLw-15bd; Thu, 06 Feb 2025 22:48:31 +0000 Received: from mail-oi1-x234.google.com ([2607:f8b0:4864:20::234]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tgAfd-00000007iKY-26GM for linux-phy@lists.infradead.org; Thu, 06 Feb 2025 22:48:30 +0000 Received: by mail-oi1-x234.google.com with SMTP id 5614622812f47-3eba559611aso410797b6e.0 for ; Thu, 06 Feb 2025 14:48:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1738882108; x=1739486908; darn=lists.infradead.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=oAgdP5/7nbSCpei3bdgHz+Kvp3J/VbeQ+Dc9cWuRxQY=; b=olrhiM5161LOAGksl4BmxYN2ugONukcu2wUkZ6REzWfjTeUNif6wpaSmDY/TWV8xFP xFHTBor/IazHxzWGK1v58Cd3TN/RhL7hG809nSM0mXtjujgChKoK/QDk0ahgBpxFUNkZ UcLHrySU8C3g6ugGE7a61QLS8QLoMMlQNi4o8lWMeGkuhTqS2lj37gkAqip5l47+qcqJ yhXZ8DBVrYORmD5VU6ILbJ6omXHvt0eSmkq5EsXDthhgP+I7lw0NzqT+7Jou5y6llDtz /gbbUG4D4NzN0XIEZk59HYTmmVWpmMzg36ZIVeQVQPBvDLWnZ80i3w8HrBuFCv6u/2ut UvSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738882108; x=1739486908; 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=oAgdP5/7nbSCpei3bdgHz+Kvp3J/VbeQ+Dc9cWuRxQY=; b=tYweGswURHHbBu44+SXDHeX3+wb0lvOKPekmL5zqk8FKHoOeY2d3k9LOHZQp+qyZpx VxzFYx/pezqN2Sy6fyB2WUU/reia6ZlV08DmS2uZ4fgF/SpKUPfn+d3za+Rxv/SiKjO9 ewrUXOj0u1SldQSiVADQeUkUFDcjtlTnjoFj2ydbYK94onrB0INDXYUi/ULdeMXW7XlU uk1WMqCdtPTzobJ7hFnHM1j/zjwieko1m4Q3Er6ucRtv2Q/4Pz3lvTcL5wfs7lvK/Wvk ZVYUaFeIFwI7RO/9CJSiWgc7XSecrOtHp80OaPC9tJBZFUJyylHl1kgpQrFArs1Dj0x8 RL7w== X-Forwarded-Encrypted: i=1; AJvYcCVGgJ7mThapAZW3DzQwB5u8KQeVe2brCC4K4zyAArUnndVJkVkrsFO9fbqLoOctSnCa6BE5bn2Pjt8=@lists.infradead.org X-Gm-Message-State: AOJu0YxKVk+QrcI3KBagC+ERw/7VG2X6kQf7H5ws2yrVpJQ+Y8p/GW4V LPE4aMysPLx+FKMoMvPPltsMH7nt7Eh7RDFGmT2aKMq42YDKeYAb10wz3SPXN6Q= X-Gm-Gg: ASbGncsa4vEZnrVVmidfXWwoq1wEJHFys5iyRa6wH1N9POD1Yog5WR2guf0cbWe8kOg opQL/swVakXBac6UcbhwPTgOGGMNxJkKFzOoQv8CSXH9pkGYOqDLFYsQf4/VGD/9kf8I5nvRd7s FcuGv3BlTOELD5Cfos//DzVn8SSHO9pUPhCX0eaUaNN7iaLpJAuoI/CVsQanJ2E3tnWUFApdDYG yE40DGDkgTOorVeokwJNAUEziDyPcpGdsWYX+g24DosSW6P9X12DJulsaNARE4Ztf7M8vAIxkhO NAvz0dEuq2h2eJd2UJwuS5bW2awRzfTJSwm8CY3R1VDyd60= X-Google-Smtp-Source: AGHT+IHR3rdzOh31Bx2HFTQsJV0ppIelp4NfQddbrynjHIrf2JbNfAwcWx67zk6KGYi6B0FrKmfqwA== X-Received: by 2002:a05:6808:189d:b0:3e6:3a82:f790 with SMTP id 5614622812f47-3f3922a086amr707666b6e.6.1738882106950; Thu, 06 Feb 2025 14:48:26 -0800 (PST) Received: from [127.0.1.1] (ip98-183-112-25.ok.ok.cox.net. [98.183.112.25]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-726af95bbb5sm510986a34.41.2025.02.06.14.48.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2025 14:48:26 -0800 (PST) From: David Lechner Date: Thu, 06 Feb 2025 16:48:18 -0600 Subject: [PATCH v2 04/13] bus: ts-nbus: use gpiod_multi_set_value_cansleep MIME-Version: 1.0 Message-Id: <20250206-gpio-set-array-helper-v2-4-1c5f048f79c3@baylibre.com> References: <20250206-gpio-set-array-helper-v2-0-1c5f048f79c3@baylibre.com> In-Reply-To: <20250206-gpio-set-array-helper-v2-0-1c5f048f79c3@baylibre.com> To: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Geert Uytterhoeven , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Ulf Hansson , Peter Rosin , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Vinod Koul , Kishon Vijay Abraham I , =?utf-8?q?Nuno_S=C3=A1?= , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, linux-mmc@vger.kernel.org, netdev@vger.kernel.org, linux-phy@lists.infradead.org, linux-sound@vger.kernel.org, David Lechner X-Mailer: b4 0.14.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250206_144829_564725_32A17723 X-CRM114-Status: GOOD ( 11.67 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org Reduce verbosity by using gpiod_multi_set_value_cansleep() instead of gpiod_set_array_value_cansleep(). ts_nbus->data->ndescs is validated to be 8 during probe, so will have the same value as the hard-coded 8 that is removed by this change. Reviewed-by: Linus Walleij Signed-off-by: David Lechner --- drivers/bus/ts-nbus.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/bus/ts-nbus.c b/drivers/bus/ts-nbus.c index d3ee102a13893c83c50e41f7298821f4d7ae3487..b4c9308caf0647a3261071d9527fffce77784af2 100644 --- a/drivers/bus/ts-nbus.c +++ b/drivers/bus/ts-nbus.c @@ -109,8 +109,7 @@ static void ts_nbus_reset_bus(struct ts_nbus *ts_nbus) values[0] = 0; - gpiod_set_array_value_cansleep(8, ts_nbus->data->desc, - ts_nbus->data->info, values); + gpiod_multi_set_value_cansleep(ts_nbus->data, values); gpiod_set_value_cansleep(ts_nbus->csn, 0); gpiod_set_value_cansleep(ts_nbus->strobe, 0); gpiod_set_value_cansleep(ts_nbus->ale, 0); @@ -150,12 +149,11 @@ static int ts_nbus_read_byte(struct ts_nbus *ts_nbus, u8 *val) */ static void ts_nbus_write_byte(struct ts_nbus *ts_nbus, u8 byte) { - struct gpio_descs *gpios = ts_nbus->data; DECLARE_BITMAP(values, 8); values[0] = byte; - gpiod_set_array_value_cansleep(8, gpios->desc, gpios->info, values); + gpiod_multi_set_value_cansleep(ts_nbus->data, values); } /* From patchwork Thu Feb 6 22:48:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lechner X-Patchwork-Id: 13963972 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3ED3AC0219B for ; Thu, 6 Feb 2025 22:48:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ogCypZgbMCVk5MViYwS/koqgqEu+ncFqz9OrZ3ndJ0g=; b=Vw8nrdrQ9N6T5q k2C1G0RH22wtsctuFgk1KFCjvrhJBzOGH5SJLWqmJxTSQuucns7EXr9vXFMfuVZy8bT0ff/bmB+Y8 T8UIIhx2Y7cMTDFXTS8g2+NZl08yE1QP2O2rrvRWI7dHoj/hGHULNn8vQA3i/dHb5S9/6YJxwa2Qz j7z5OVjh0bZf0n6SKX3i9M39KB3n0sLVzC4mX8J0SEdFtoGiGNzhjNTcgaKwDv/wXnfOXOMYtbUXU Ox2BxNP5cwnt6LGKrr8jZoTY1TuXtuPFGswdPMHlf9a0J6FtwWttf2Fi0qfGYoEQq2J8quvGq+bwj 0BK5LdBQcWug+uWDjTug==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tgAff-00000007iLc-00Qz; Thu, 06 Feb 2025 22:48:31 +0000 Received: from mail-oo1-xc33.google.com ([2607:f8b0:4864:20::c33]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tgAfd-00000007iKV-0Dpp for linux-phy@lists.infradead.org; Thu, 06 Feb 2025 22:48:30 +0000 Received: by mail-oo1-xc33.google.com with SMTP id 006d021491bc7-5f4ce54feb8so813326eaf.3 for ; Thu, 06 Feb 2025 14:48:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1738882108; x=1739486908; darn=lists.infradead.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=1G+5KuhaA9Y/JWZMuBnNAEnz6cO9OcsXFwLiAeC3p1s=; b=1v0B3reZ8VdrFQXLTGxDdO+KIhlrrSTRuVwjjD90/Fs1Va83OmMUwp6DaIZQgY3TK+ 9/zP1JXEuFqvfbALVBs1Ae77GLWgNt2VM5V9RMzHoFIEBkfwocFGlQpOJ+CLzBYoz+iq bpjzJWIOBvAZWKpBn7kYRU31wYZkn0r1FtV8Mukt6NTMW7j02F4M+tVeNu7lMlJvGMav DI5/2K7wtd73xEAg5G8rgiK8zjElFfp7HYtgMjTmF+OgG8Fv0Awz0BAQVQPm9sgsVrOA GfoXWhSH5mRIXEVVeCw1BLPFFiR8xx0KlvmUMt96L5RJij+48I/ts3ZV6QlPFQ8BeRC7 AoGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738882108; x=1739486908; 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=1G+5KuhaA9Y/JWZMuBnNAEnz6cO9OcsXFwLiAeC3p1s=; b=ETMsd1l8L+qNgvMEU9qoWil6dy9KlUUfEIlyNfCnbMHgRr9r/JEHHK4h/LebVvkr7s EyYF7OIgMxHg6nc1c+sxi0tOGJVbF8vBXvqG/Qw2kf+FW4lrj5mNBQo0i2xNSf5P0Fns QHw2rdMAbNUtZU/Zrfm5ZUsEjnBNy8e7rgiZsGFIr/X8ij5cFFH0IAJcbh1dt7HwOrjS wKdO+993eKCu6bl4lzvjjQtqfFCcws1kP1MW5IWr/vD0W5zdgr4CzXqU0ONL9LcZnHep bUT/q6tPeBNO5+iN1a7eAjRG89WAW/3xKaP+VYKGwSnEI2LRCGattNrLWgiKWeHVRGq7 eYow== X-Forwarded-Encrypted: i=1; AJvYcCUATKLDxSKWyML6Uk7LWRbqU9d+aG+TgjKB+ED+/5EWzG+iPihkfwYsR2HB8Lc1DB+P5U6GalojpWw=@lists.infradead.org X-Gm-Message-State: AOJu0YwNHFEOzpvLwVw4rQ2ET1cF7+v0N9zFRZ9tRbe3TEW0vnhffM3X 2+X0Bd1QV3f9jFhvAsx6ui0HSvh8965JMrhFGi6BpTOwecMyOOyewa8oiG0NRck= X-Gm-Gg: ASbGncsKZWtsP4uhSit4X0NCHykYldGax2aimHuVwPXHMdoALW2cr1lvC3QJUoqBgnu KL4mxnM6wScu9gMgT7dBeTYzvRD0JJoIzGP0nX8mr+COmwkTEIyr4urSji/bNmcFGHWh1kpSL2J Z1kk4hv/meKyUSzj8PSAI/rXRa7FdJqIW3sAd9f0vAXXtpf+tJPkkQmgJX7m68/BIttbAy7Yfd6 9Ec7m28sl6/Fxqi3K2E/wmb6S10LmgBetNMPC8FdQVSMMRX2NHlOGHu3jr+I7RcwTEvGpSioxvu hHO1j/q/1TsSDaVRUUNWRF/8EJfDrVrGIpxh3Iyvesca2fk= X-Google-Smtp-Source: AGHT+IHhS6xIbsoZ9Y9JyXWh4zSyrZ2jgd8SnPiV9tauY6RFNa0jyaYnEj0rYnfG1jHSP16xj2DPIg== X-Received: by 2002:a05:6871:70e:b0:29f:b7f1:d844 with SMTP id 586e51a60fabf-2b83eb6727cmr752453fac.2.1738882108087; Thu, 06 Feb 2025 14:48:28 -0800 (PST) Received: from [127.0.1.1] (ip98-183-112-25.ok.ok.cox.net. [98.183.112.25]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-726af95bbb5sm510986a34.41.2025.02.06.14.48.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2025 14:48:27 -0800 (PST) From: David Lechner Date: Thu, 06 Feb 2025 16:48:19 -0600 Subject: [PATCH v2 05/13] gpio: max3191x: use gpiod_multi_set_value_cansleep MIME-Version: 1.0 Message-Id: <20250206-gpio-set-array-helper-v2-5-1c5f048f79c3@baylibre.com> References: <20250206-gpio-set-array-helper-v2-0-1c5f048f79c3@baylibre.com> In-Reply-To: <20250206-gpio-set-array-helper-v2-0-1c5f048f79c3@baylibre.com> To: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Geert Uytterhoeven , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Ulf Hansson , Peter Rosin , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Vinod Koul , Kishon Vijay Abraham I , =?utf-8?q?Nuno_S=C3=A1?= , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, linux-mmc@vger.kernel.org, netdev@vger.kernel.org, linux-phy@lists.infradead.org, linux-sound@vger.kernel.org, David Lechner X-Mailer: b4 0.14.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250206_144829_100745_AA9DDB80 X-CRM114-Status: GOOD ( 11.72 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org Reduce verbosity by using gpiod_multi_set_value_cansleep() instead of gpiod_set_array_value_cansleep(). Reviewed-by: Linus Walleij Signed-off-by: David Lechner --- drivers/gpio/gpio-max3191x.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/drivers/gpio/gpio-max3191x.c b/drivers/gpio/gpio-max3191x.c index bbacc714632b70e672a3d8494636fbc40dfea8ec..36ca07be3e1811fd3f0b27f41bfd307de50ec5b4 100644 --- a/drivers/gpio/gpio-max3191x.c +++ b/drivers/gpio/gpio-max3191x.c @@ -309,23 +309,21 @@ static int max3191x_set_config(struct gpio_chip *gpio, unsigned int offset, return 0; } -static void gpiod_set_array_single_value_cansleep(unsigned int ndescs, - struct gpio_desc **desc, - struct gpio_array *info, +static void gpiod_set_array_single_value_cansleep(struct gpio_descs *descs, int value) { unsigned long *values; - values = bitmap_alloc(ndescs, GFP_KERNEL); + values = bitmap_alloc(descs->ndescs, GFP_KERNEL); if (!values) return; if (value) - bitmap_fill(values, ndescs); + bitmap_fill(values, descs->ndescs); else - bitmap_zero(values, ndescs); + bitmap_zero(values, descs->ndescs); - gpiod_set_array_value_cansleep(ndescs, desc, info, values); + gpiod_multi_set_value_cansleep(descs, values); bitmap_free(values); } @@ -396,10 +394,8 @@ static int max3191x_probe(struct spi_device *spi) max3191x->mode = device_property_read_bool(dev, "maxim,modesel-8bit") ? STATUS_BYTE_DISABLED : STATUS_BYTE_ENABLED; if (max3191x->modesel_pins) - gpiod_set_array_single_value_cansleep( - max3191x->modesel_pins->ndescs, - max3191x->modesel_pins->desc, - max3191x->modesel_pins->info, max3191x->mode); + gpiod_set_array_single_value_cansleep(max3191x->modesel_pins, + max3191x->mode); max3191x->ignore_uv = device_property_read_bool(dev, "maxim,ignore-undervoltage"); From patchwork Thu Feb 6 22:48:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lechner X-Patchwork-Id: 13963974 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C0CFEC02196 for ; Thu, 6 Feb 2025 22:48:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9Coc9nFmPFHGMI5mY77bnaHcOOPygc3JwfbKdIVpRAM=; b=nLfr0YeQAyeC9D XqnHo0rz+NNSrTboilWOmPV34x7OjXgNbVkO7XHIsy0TZu/XIrMx1/H61tHurUgLP355TD5x+tC0E rbRQGQ7gpNhpgzfQfYy0NxQiFYIiTOXAfyK6vvmO/VUfctFYS+umqps5wW2U3EhCHuICYPuTLmKJ6 H/94zV5j08ep+U0W7TkSmajo7jh1BEn3a9COQUXD5wssPitvIotl2lwL+i94Yq7nFxOBGCOPW2JK7 m31Jch7frZCyReOWKe2q8QwrNZrhsDeBleosoqmhkFG/Ixow15lJLRRmU2NO74Ehpviv/SzdDA0rv n10TgWDx/G7h5gmmPDWg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tgAfh-00000007iNU-2FPv; Thu, 06 Feb 2025 22:48:33 +0000 Received: from mail-ot1-x32b.google.com ([2607:f8b0:4864:20::32b]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tgAff-00000007iLb-1lyn for linux-phy@lists.infradead.org; Thu, 06 Feb 2025 22:48:32 +0000 Received: by mail-ot1-x32b.google.com with SMTP id 46e09a7af769-71ded02b779so880373a34.2 for ; Thu, 06 Feb 2025 14:48:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1738882110; x=1739486910; darn=lists.infradead.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=b7U1tr86Bxzg8KMxqprTIoKXgh7O+YeZXgnU26M/an4=; b=lo19AbXfRnN9QNUzTSnl6c2rQI92wUK706bCLuv/xZS7ZR4TxEqX5YvSQ89VKnhpb4 yuJrV3MgwSlknJKBDuCd2Fc56IfXJhhy8CP4XImrrnDU7jx+yakZwTgytgOr+Td2Rt8r IQy7wpHvekE3PwtR0byt2i+PJw+bhSNc1wkYwA1aYg6lYCKUfbkIue+QqZI4hxVZDMD/ lbySPIU6B8liiasFsOrQh8k0s3jaXDsFmQn9YNht9fmmGUV5LJkhQhbNRAsVptyk3l6i xoQiymAAvBGf7xQY4v7FcC4T75t5uU+nQxZDI0NPIGMBS/G6VfUga9Z+2Be0fUO+K5Xc A4KQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738882110; x=1739486910; 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=b7U1tr86Bxzg8KMxqprTIoKXgh7O+YeZXgnU26M/an4=; b=jfXhKLbvUzxw+NzPDcDOSUxIzlBm+rUdyRclcOEOI8ECG1y8c8uGWNYMocQfg8rlP2 jr9foppIscC1hFMdbSBiRYos3ngyPWBicuUZ7Fc+jWGVWJBj93b1VxUXnPkL5ltvqcu/ GXSTFHxCVxwaZQkVHQMP/S4FsXJA00sAdt/hViJFrVEWCHuT1EkE72qam54n74eggCWA UHhQ6NW5c+0i/xT26byJWhTCNy3emfJBWzNiasVzlQY7f/QDjCqxVOZ3WSt5Cg20UpmB a2yhFL2MSPSGazGDtpF8JDJ9q8wqqCcKB5mL35Bnv+SLAoG+g2VFU+dKjwtIwnkUpqzv 0AuQ== X-Forwarded-Encrypted: i=1; AJvYcCWMhNAQbOSueJAnlnrwX8f3gsGkixJRne6RouJlNLGATcyAm5JQk1QkXtIXF9cGtFWQUvYlOkDnG1Q=@lists.infradead.org X-Gm-Message-State: AOJu0Yw0Trh52BWkqybyLLvtA9nNoHyREkR4mXZMqaxOP84jcTho0nt1 4JtwlTZApJZmnUrcrZ2eLe6UJ6J5O1Vx5HAnXR0Ycd/kWdd97MdanE+33xE2S20= X-Gm-Gg: ASbGncvc35R5Brzx5CsxsT+IeV8mNiFoTCGktgELwwbyXxpoi4J+Mc5pNIdvb2EWhyj QhHVAp1gsrS9MJ4ggLI16NFfeBU/zvIE+e3EXCzVBy6Iy+Th9y33hzI5WpaoKrBacO/o7w0aBMH gF54SyAK/o8dk5t1IE6N9JOyEBmZOYkrb1n3ulSDEXC4McJYPx4PdoMutTsrsEOevl0YXZjTSyD SR7GOWHLeJs+CC9wP3Up1Iaqbpey65D/cUiTKzAqiuQEqrlpGUeokQC4ATmYpVM7KzqC/PmWMGh G4+ruu6H/nHFyqI8+tEgH6yx9FKYhw36WdzUVox/A24wqjE= X-Google-Smtp-Source: AGHT+IH50vqJ+UKd/x8agnmRsrebnsoHILBPEML/hHVzdaMwyiH1jtZh+WCDNiEdIClFYG2pC1GB1g== X-Received: by 2002:a05:6830:6710:b0:715:3258:4ea9 with SMTP id 46e09a7af769-726b88023b4mr646049a34.16.1738882110277; Thu, 06 Feb 2025 14:48:30 -0800 (PST) Received: from [127.0.1.1] (ip98-183-112-25.ok.ok.cox.net. [98.183.112.25]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-726af95bbb5sm510986a34.41.2025.02.06.14.48.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2025 14:48:28 -0800 (PST) From: David Lechner Date: Thu, 06 Feb 2025 16:48:20 -0600 Subject: [PATCH v2 06/13] iio: adc: ad7606: use gpiod_multi_set_value_cansleep MIME-Version: 1.0 Message-Id: <20250206-gpio-set-array-helper-v2-6-1c5f048f79c3@baylibre.com> References: <20250206-gpio-set-array-helper-v2-0-1c5f048f79c3@baylibre.com> In-Reply-To: <20250206-gpio-set-array-helper-v2-0-1c5f048f79c3@baylibre.com> To: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Geert Uytterhoeven , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Ulf Hansson , Peter Rosin , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Vinod Koul , Kishon Vijay Abraham I , =?utf-8?q?Nuno_S=C3=A1?= , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, linux-mmc@vger.kernel.org, netdev@vger.kernel.org, linux-phy@lists.infradead.org, linux-sound@vger.kernel.org, David Lechner X-Mailer: b4 0.14.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250206_144831_471147_C35BA1F3 X-CRM114-Status: GOOD ( 13.90 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org Reduce verbosity by using gpiod_multi_set_value_cansleep() instead of gpiod_set_array_value(). These are not called in an atomic context, so changing to the cansleep variant is fine. Reviewed-by: Linus Walleij Signed-off-by: David Lechner Acked-by: Jonathan Cameron --- drivers/iio/adc/ad7606.c | 3 +-- drivers/iio/adc/ad7606_spi.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/iio/adc/ad7606.c b/drivers/iio/adc/ad7606.c index d8e3c7a43678c57470a5118715637a68b39125c1..9a124139924e4a4fbbbd234a8514eb77024442b3 100644 --- a/drivers/iio/adc/ad7606.c +++ b/drivers/iio/adc/ad7606.c @@ -818,8 +818,7 @@ static int ad7606_write_os_hw(struct iio_dev *indio_dev, int val) values[0] = val & GENMASK(2, 0); - gpiod_set_array_value(st->gpio_os->ndescs, st->gpio_os->desc, - st->gpio_os->info, values); + gpiod_multi_set_value_cansleep(st->gpio_os, values); /* AD7616 requires a reset to update value */ if (st->chip_info->os_req_reset) diff --git a/drivers/iio/adc/ad7606_spi.c b/drivers/iio/adc/ad7606_spi.c index e2c1475257065c98bf8e2512bda921d6d88a3002..0fc41275e79f3af282c0ee4f31e222bbe8d8c1d2 100644 --- a/drivers/iio/adc/ad7606_spi.c +++ b/drivers/iio/adc/ad7606_spi.c @@ -297,8 +297,7 @@ static int ad7606B_sw_mode_config(struct iio_dev *indio_dev) * otherwise, they must be hardwired to VDD */ if (st->gpio_os) { - gpiod_set_array_value(st->gpio_os->ndescs, - st->gpio_os->desc, st->gpio_os->info, os); + gpiod_multi_set_value_cansleep(st->gpio_os, os); } /* OS of 128 and 256 are available only in software mode */ st->oversampling_avail = ad7606B_oversampling_avail; From patchwork Thu Feb 6 22:48:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lechner X-Patchwork-Id: 13963975 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0C9EAC0219B for ; Thu, 6 Feb 2025 22:48:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/UQHgDbTg0jvWSF+xA/KPKp5Ayh6pB2hkDddIHRDNOs=; b=ECfF8+DgehmF7r sxBBVfQUfgXrV2iEYOI8330DWzWcQ/1kiRo9t9EBg/K9ikJwwEvNxxq65l+G+AMb5RMdjyMeW7Osm vbpAuBNbO8AFlgjvkUQuRCLx/SD8VnODIJ0qJMPG0y7kjFPy85dP+h84naY2QN2V58Rhuwyg0EIVm tbAbkNDgfaE6EhNsRqu4p+0y17mOhFFa18mRfdVbggoEL0wiaarSd9WA6/bG5vGqEX4QIa2tCCbhe Y2VPJ1qxWa8hZvGiHx7whRRsmExlQpBCmXo6r9bD6nXDM/UlLJGBqIT88k+WrJCjdSEX0OAhn0jED HrqXdSXK6frFkHH5nzog==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tgAfi-00000007iOL-3Msh; Thu, 06 Feb 2025 22:48:34 +0000 Received: from mail-ot1-x336.google.com ([2607:f8b0:4864:20::336]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tgAfg-00000007iMh-2PUY for linux-phy@lists.infradead.org; Thu, 06 Feb 2025 22:48:33 +0000 Received: by mail-ot1-x336.google.com with SMTP id 46e09a7af769-724d1724657so1335007a34.0 for ; Thu, 06 Feb 2025 14:48:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1738882111; x=1739486911; darn=lists.infradead.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=+wznyorGz9Vd3pJ7hNo9c2JQSgu4MoX0a4PWBg4SPl0=; b=BUV7q/14nfpOYfxcVU7oNSTLdN+az/hayMYWVpiSAZSFHVBRVWHHW2fzpXW+DIhkU2 vtXRw6vqdDoKEG33IkHo0xSJyjjCKZXeiZ/OMV7KqAp8sU0hmHe968kjdXLizPr4jUy0 AaBLYxiYXGXCeUWwHoe2TypTkxQa9cbC0V2Mtc43PHHj8aJlGjvVtEHZx0U33C48bUFZ rztnnDKfYbRgdRucwLg6FhqbXx0vRrPkSBp3IseolJgGmZ81mRBQkingBMM1mBzL+a32 UhtSjrYLBSreP4/bm10vRCfnRX9k02HOZXRLOZOeMwbNKkpv4iztkY5YlQh6OxHHVnOr z9Cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738882111; x=1739486911; 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=+wznyorGz9Vd3pJ7hNo9c2JQSgu4MoX0a4PWBg4SPl0=; b=aT31gsE2QBmswUQycm9fziRZ3vOe9GwzOz/g7K7JfWZeOzy4bchbbFKjl73uIbxkX8 rR2Z52kKhNle2tNv7gWU5IhaoD4MX/ojDmwVAwPkhMBHTeVPxznzYkCUrdgaRqO/m4+i zSgVj8QxohH5qqFaSoz9NJEZISdb5EJtSRvwYVW8q17LiCMIS/1Ndyl51m8AtLBjWJ6p TDq/YEhuupooNHZNnw0m+fyYh8UBWjM4ANsrgSn0bXqzkkUdi0B41XH8EmYFXbkVKLlJ MX07RMy4EzxuxkTGnvrjAzWIPxgmiepytVYCdftgZvUv31/paIBlF9fp3GTuCuyHZTl8 jy2w== X-Forwarded-Encrypted: i=1; AJvYcCWhAzW28+cLsOJQQcICVp3ZkwPerwZ1pANthiHxZn/1GPx5dKQw9LbLj4QxFFWIQGI+eLJcko3hUM4=@lists.infradead.org X-Gm-Message-State: AOJu0YyEqTb1YeKJqZE6HmkLei5p2eA89JIcin6A3uLe5tQ6o2prHRzO LJ91/y0EsK/AdB/9GrEFfGcs9jY4XL4iXZecmgyVrgNmLpCkzM44K15n79eehUY= X-Gm-Gg: ASbGnct97hjANURnAT/BI8XD6euBlDf6sxiweI16GtsIDmz4cyBdKDnVwKdUF5H8wy0 jVUhjJFrou8B+nTtGIrlXzaNAQ3DYGxHdR1CqqD26VhkzAtyxL96ghkUGBECEyTaxIzCutKvBC+ ve3kDM35vUkfwUZRoDlp/Ldpbwwyb+AfYBBLLb6Hn5fP0vtNwET1Z7jxOO30ZBqn9LnVIK11yAs ch/KsXx4dwlHngqq0y6BKnWB8e3yoR2JN3MTUcZ7FGlzJQM/SfxKOo6t3DrzLz396ZjijnXXZLV t5YIptYPYsKteCgEspPMMnXsLHI31qQ+lfk7hbbgI96dbqw= X-Google-Smtp-Source: AGHT+IFY5Ed96/KcKz8L7aoyZ9lE6qS5z+d/+9NsZ4rcpOBs9+vdKruwDq8O9FLpVqE3mmL4J2bJeg== X-Received: by 2002:a05:6830:3981:b0:70f:7375:e2b5 with SMTP id 46e09a7af769-726b8f3ab09mr416508a34.6.1738882111587; Thu, 06 Feb 2025 14:48:31 -0800 (PST) Received: from [127.0.1.1] (ip98-183-112-25.ok.ok.cox.net. [98.183.112.25]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-726af95bbb5sm510986a34.41.2025.02.06.14.48.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2025 14:48:31 -0800 (PST) From: David Lechner Date: Thu, 06 Feb 2025 16:48:21 -0600 Subject: [PATCH v2 07/13] iio: amplifiers: hmc425a: use gpiod_multi_set_value_cansleep MIME-Version: 1.0 Message-Id: <20250206-gpio-set-array-helper-v2-7-1c5f048f79c3@baylibre.com> References: <20250206-gpio-set-array-helper-v2-0-1c5f048f79c3@baylibre.com> In-Reply-To: <20250206-gpio-set-array-helper-v2-0-1c5f048f79c3@baylibre.com> To: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Geert Uytterhoeven , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Ulf Hansson , Peter Rosin , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Vinod Koul , Kishon Vijay Abraham I , =?utf-8?q?Nuno_S=C3=A1?= , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, linux-mmc@vger.kernel.org, netdev@vger.kernel.org, linux-phy@lists.infradead.org, linux-sound@vger.kernel.org, David Lechner X-Mailer: b4 0.14.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250206_144832_616602_32DD6E31 X-CRM114-Status: GOOD ( 12.83 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org Reduce verbosity by using gpiod_multi_set_value_cansleep() instead of gpiod_set_array_value_cansleep(). Passing NULL as the 3rd argument to gpiod_set_array_value_cansleep() only needs to be done if the array was constructed manually, which is not the case here. This change effectively replaces that argument with st->gpios->array_info. The possible side effect of this change is that it could make setting the GPIOs more efficient. Reviewed-by: Linus Walleij Signed-off-by: David Lechner Acked-by: Jonathan Cameron --- drivers/iio/amplifiers/hmc425a.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/amplifiers/hmc425a.c b/drivers/iio/amplifiers/hmc425a.c index 2ee4c0d70281e24c1c818249b86d89ebe06d4876..d9a359e1388a0f3eb5909bf668ff82102286542b 100644 --- a/drivers/iio/amplifiers/hmc425a.c +++ b/drivers/iio/amplifiers/hmc425a.c @@ -161,8 +161,7 @@ static int hmc425a_write(struct iio_dev *indio_dev, u32 value) values[0] = value; - gpiod_set_array_value_cansleep(st->gpios->ndescs, st->gpios->desc, - NULL, values); + gpiod_multi_set_value_cansleep(st->gpios, values); return 0; } From patchwork Thu Feb 6 22:48:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lechner X-Patchwork-Id: 13963976 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 84058C02194 for ; Thu, 6 Feb 2025 22:48:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FsDl7aLYzZqgdNFJK1eP/EtiKcVjPAgyb3yD0JefTJA=; b=mLlPKeKIoL9dUH xIxj9Q5a9h9nM6LmSVmrm2lIAirR1fYIxGUwMLZucHI9gfpOKrkNHhDUblePU/daQYUj3ogBpSzjO uZ4Z4MSsTne4fqCNcdlzQFKpqOZQANab26s8OulkyDPVAFz5Q+ntAu9XMsR/2gq1TeoqKUfNtfuvL OgoNHolmksxOLwT6bkKfEpIaHNSaP06FwF/OsQQHWfImMegi0P33sp0X3Ea3pIsYzUbkHh0BHC17e +2vVfWuZRiKuoMbROjKx8qVeZTJ3i0fmMsvzP/mjN/Bqo5cY1H+qPcpgvWxgowUxRcU2cSk6gcHsG fuP0guU5TlVb5Wc3mkZg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tgAfj-00000007iOr-1Dz8; Thu, 06 Feb 2025 22:48:35 +0000 Received: from mail-ot1-x32c.google.com ([2607:f8b0:4864:20::32c]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tgAfh-00000007iN9-1MRq for linux-phy@lists.infradead.org; Thu, 06 Feb 2025 22:48:34 +0000 Received: by mail-ot1-x32c.google.com with SMTP id 46e09a7af769-71e2766994bso849776a34.3 for ; Thu, 06 Feb 2025 14:48:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1738882112; x=1739486912; darn=lists.infradead.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=Qt9BcvBwXw7VI7drRQ9jRI7HoN4iY1rdT776+r9izwk=; b=TSZpQ2vFYYydpR6dQLMtGcnH44BaaXw6w9XArNlkXXQP0U6BFe5/V3xxHjDG0Du3zt OqSPilftiHdeU5AuZR3pHlnAVTSjiU1qNpduKJL3eh9Mi5F9NDCDHrkyFk4gUL45QgWt HW1vp6PZ+DnqdIotY8NlPrprFl+lnFzKr9BnMV2uIuBzKZkb0SGaBSEeGzh6XIqyQvM4 IkvWTnw553nOx0mVJzTP53ex9K5EI+nRF2XlgbsD87tWMXrbI2IwA+msN8Dzn60UDQB0 +IYDprBg8SJgSXsaEOVlOZtqjJIeUbGV1CBIKfoRltY/pbTSd5d6rjZxIWtlKy+i1RHS XdyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738882112; x=1739486912; 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=Qt9BcvBwXw7VI7drRQ9jRI7HoN4iY1rdT776+r9izwk=; b=eZotjvS0M7BEzMXuXr9/tXMWimvNK9JCwT6o+xZcQX74qUMhPco/oM/gM9BUvKifNT ut4SzI8d14fdq3E7gPUxFgiqfHXB8PFfjlxkj8IhokjWgP97MLPy1t5XZBHCBBc7EaYz xGTJ105047bGhMi9/Zgdm4uqdKL+AqDqr1YG135vL6aRPQkA1ZDhB2x8/8eCNah/1qhc kKF/B6e5lRE5GveV4NFP4Oa6xGUpPIoSS/jJuhU97miiacKrV+SSfycz5VjrBsh7mvHP vt6itWm6mBpAULWlTMZMF+y4n1tYBzOvfMEKIGTKjE6sjYSIZsetoNiZJXRs6oC4UfBh GBpQ== X-Forwarded-Encrypted: i=1; AJvYcCWRdSiN3RydHhDtV2IaGtPrfk0KP/3jGdQzDSG+2OmhsA9GOFGTEy0E9qFFto8lS+WWvEN0QTGGzkE=@lists.infradead.org X-Gm-Message-State: AOJu0YwKCwPotaDECVn7jnAauKhre5uLIWpDq9BhoRt2xy79vIU5rYl6 6ioEjk9QP4KhqA4R0E4+nLvXeoRxUjxrYzl2J9d5nOMUnrwJr+avZxkiwOwtXhY= X-Gm-Gg: ASbGncviVRV9s2x55t/qZzWFN+IQXLOf+BtVzzXzm7bG/GZW8FEB22fP4ZPdFFSDjs6 wufkvsY1JIAdak1vQD3C2Keir5cCxJn6Ta96NpCUKQPLdmC+lJk1E86SpxWZbzZUBFH9VajVN7F /ZXp6FezI1UWc1nV4Dj/i1yw+ixQ30bPwiZ6z/mZYIqDxZCqMvPVPyefax1ZPaHWRkVAI0XkWoG 9PtCGoKGQ7MVP3x03vz01P+SBBAT/Ezmza/JzFNHQ8Q1YiE54MmdJAtIefButaiC3MUHX0B7kOA lJm7dAy6Ich8fr8FUlhi7a9OM4xmc2JFQnE7w7tHopWi2kM= X-Google-Smtp-Source: AGHT+IHXxKi2A/XYeV5UWyLNbvoQ8dEflCn5kPNBQNuzG5uM6VGTHdJPWbFF8OVEjlJC3/X0uqQhvA== X-Received: by 2002:a05:6830:668e:b0:71e:48b1:ad28 with SMTP id 46e09a7af769-726b87b3665mr815075a34.4.1738882112753; Thu, 06 Feb 2025 14:48:32 -0800 (PST) Received: from [127.0.1.1] (ip98-183-112-25.ok.ok.cox.net. [98.183.112.25]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-726af95bbb5sm510986a34.41.2025.02.06.14.48.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2025 14:48:32 -0800 (PST) From: David Lechner Date: Thu, 06 Feb 2025 16:48:22 -0600 Subject: [PATCH v2 08/13] iio: resolver: ad2s1210: use gpiod_multi_set_value_cansleep MIME-Version: 1.0 Message-Id: <20250206-gpio-set-array-helper-v2-8-1c5f048f79c3@baylibre.com> References: <20250206-gpio-set-array-helper-v2-0-1c5f048f79c3@baylibre.com> In-Reply-To: <20250206-gpio-set-array-helper-v2-0-1c5f048f79c3@baylibre.com> To: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Geert Uytterhoeven , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Ulf Hansson , Peter Rosin , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Vinod Koul , Kishon Vijay Abraham I , =?utf-8?q?Nuno_S=C3=A1?= , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, linux-mmc@vger.kernel.org, netdev@vger.kernel.org, linux-phy@lists.infradead.org, linux-sound@vger.kernel.org, David Lechner X-Mailer: b4 0.14.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250206_144833_369358_919EF70F X-CRM114-Status: GOOD ( 11.96 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org Reduce verbosity by using gpiod_multi_set_value_cansleep() instead of gpiod_set_array_value(). These are not called in an atomic context, so changing to the cansleep variant is fine. Reviewed-by: Linus Walleij Signed-off-by: David Lechner Acked-by: Jonathan Cameron --- drivers/iio/resolver/ad2s1210.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/iio/resolver/ad2s1210.c b/drivers/iio/resolver/ad2s1210.c index b681129a99b6cf399668bf01a1f5a15fbc4f95b8..7f18df790157f1e411fb70de193a49f0677c999f 100644 --- a/drivers/iio/resolver/ad2s1210.c +++ b/drivers/iio/resolver/ad2s1210.c @@ -182,8 +182,7 @@ static int ad2s1210_set_mode(struct ad2s1210_state *st, enum ad2s1210_mode mode) bitmap[0] = mode; - return gpiod_set_array_value(gpios->ndescs, gpios->desc, gpios->info, - bitmap); + return gpiod_multi_set_value_cansleep(gpios, bitmap); } /* @@ -1473,10 +1472,7 @@ static int ad2s1210_setup_gpios(struct ad2s1210_state *st) bitmap[0] = st->resolution; - ret = gpiod_set_array_value(resolution_gpios->ndescs, - resolution_gpios->desc, - resolution_gpios->info, - bitmap); + ret = gpiod_multi_set_value_cansleep(resolution_gpios, bitmap); if (ret < 0) return dev_err_probe(dev, ret, "failed to set resolution gpios\n"); From patchwork Thu Feb 6 22:48:23 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lechner X-Patchwork-Id: 13963977 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C8A9AC02196 for ; Thu, 6 Feb 2025 22:48:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=iMkHR476oMdYSvp6v8ZsQOT5MNrVHOBoslWMHDv69AQ=; b=q9ZlT/MP841kDs bfmPi1wjuKU4SQrfNZJD1nCI4+Tm6y9yVdt7CeHnNsWriPO/yDsQfxt86UsDn5LrN9AP+U4zUT0oW wTkVhFVe24fMyWDfzh7mtvnLO6pAtT2eulNQa9pA+nc1XPR7BdN2LDvwHLcPBaa/npQKId/55wheX I7QFGXLZa0SPSwi+bC65JXmF8eTcZeaBaXTENSP20cDi0Qf6kGc5Aj63XJRpR5y2PNbDjrWFMMUJi zcoCMzv9/YphaZnLQvRbRw1/6omSpfopbleEaqUdg+LiFBjV6Mq003Wf9o+eLuahMt1JWefjffHhf QO3BERFbH2+cfqnb9qeQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tgAfk-00000007iPa-2LTN; Thu, 06 Feb 2025 22:48:36 +0000 Received: from mail-ot1-x32c.google.com ([2607:f8b0:4864:20::32c]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tgAfi-00000007iNr-21M3 for linux-phy@lists.infradead.org; Thu, 06 Feb 2025 22:48:35 +0000 Received: by mail-ot1-x32c.google.com with SMTP id 46e09a7af769-724d1724657so1335028a34.0 for ; Thu, 06 Feb 2025 14:48:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1738882114; x=1739486914; darn=lists.infradead.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=Hnz0az7lntDGiOpb5KMBiHYUt+/ZN1SFQQir1JT9FNk=; b=GvV0lpDezUz3ZZ3vbm7Nrfp14SYG/8f7tCMzsz0VMlCAgiK8GvxxCvwdxxA3G0t3mG osHW1O+Ga1CMZpndpMAXIAaK0LoxkN4FWlxJIi+PZwTLF1g/cgdpeZ15eAnv2Umq20Dd fa6Hu15zPQh9wVV5aEooF844Ccc2M8sqew1XlYznjSJ+kV1iYLD4sJ4oZmss+eZ1xGPH gK5fT/kEsdZ84J9M7mIDxYwgcRuKtszWQ4jlYLBZghcUN1e3kXeI2bm4kXSMINhGKPpI vS7nNsh+Xw7U/+/xjpapThOFz3/YU45qc7mRkJ/Avctkl1LMsAKxhGB4+r1E9dr6/oaI +6ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738882114; x=1739486914; 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=Hnz0az7lntDGiOpb5KMBiHYUt+/ZN1SFQQir1JT9FNk=; b=UvNokvicDtgJUsqo9ipIhSVUthFqQQ4OBFMeYHVjMLBhYx+AeIS0oCd3JXZ053ZbN5 8LlqmrXK5UxKNdOTT49utV8YJl4MYLO3ykOlvQsPgx+JC2xDjC0gBQlh1K9WrvZn2Q2U 5MlhSCwqrJWSjTNgkGnWXPo0bRsCDNhsoQzRPm+j6KlIAaRb5WX1ElTVFSks0gOwcIfW F4aYSJ0OSvik+ynBOJH1rHGlZNg3l2tFw9Say9p903VERKzOixhSDV8UWgJmapUdGcEK /h3yF/xphffHCH4xvkyPOfKhVj6v0Rdw5AsQ1FBVqdyxv1EhsZ8Tt+eUWGr5mRdVRV9c 5/jA== X-Forwarded-Encrypted: i=1; AJvYcCUOD0Q6jsELEE6JBdVElbAZkgv4dNODPfcrzeYUB7+RtPavcRVqIjRYh6adm5JPRhDhYZkjr+GoDrw=@lists.infradead.org X-Gm-Message-State: AOJu0Yzl9MRlvjc9z3lGtdMBgBho2Q7UVZOZB6kHS5vJ/VEcTm91zTQ7 3ZWDKO0KV2HOja07h2EaesWeRtWPtjCPVJv2kdNfBweCOKbQHnRueIx7ePCdmfI= X-Gm-Gg: ASbGncs/ozIdTpABU2XZuTuOl6dQ2CUdDr4F3HNY/pWml4+kxktG56oIqlefrzZwZK/ ZVY1JUrTLUei/C4z2QwlTdEnAJPFVFOWft1WcKayKBklE+RbarnZy+NAJ5yypxFP+MahVLGWRtL fi2NMD2mZ+vXXTePl4mB4fE6U0iAHOyYr8tF1kffMza7hYz5M50vcHzReH8MJ1NLlbZaeMBd0Yq s3SNZPrcfxr2ZYTYMOm5BwNpOkqmSddOW9tAGtBuMmhCn/wpqGlkbMU34KmhQyIX1y7BEVJouku 01PVCHkT9IX3ENIkJCkyqTABMI0PcRI/4uDdK5OM1pt9nds= X-Google-Smtp-Source: AGHT+IEVknGonsegy5S/Aw+PLXi2TjO/wnkH/rmRbYYU8mAcrJGwZvntuKEgjA/jQ79DrZ7uQxsojw== X-Received: by 2002:a05:6830:3981:b0:70f:7375:e2b5 with SMTP id 46e09a7af769-726b8f3ab09mr416555a34.6.1738882113893; Thu, 06 Feb 2025 14:48:33 -0800 (PST) Received: from [127.0.1.1] (ip98-183-112-25.ok.ok.cox.net. [98.183.112.25]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-726af95bbb5sm510986a34.41.2025.02.06.14.48.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2025 14:48:33 -0800 (PST) From: David Lechner Date: Thu, 06 Feb 2025 16:48:23 -0600 Subject: [PATCH v2 09/13] mmc: pwrseq_simple: use gpiod_multi_set_value_cansleep MIME-Version: 1.0 Message-Id: <20250206-gpio-set-array-helper-v2-9-1c5f048f79c3@baylibre.com> References: <20250206-gpio-set-array-helper-v2-0-1c5f048f79c3@baylibre.com> In-Reply-To: <20250206-gpio-set-array-helper-v2-0-1c5f048f79c3@baylibre.com> To: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Geert Uytterhoeven , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Ulf Hansson , Peter Rosin , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Vinod Koul , Kishon Vijay Abraham I , =?utf-8?q?Nuno_S=C3=A1?= , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, linux-mmc@vger.kernel.org, netdev@vger.kernel.org, linux-phy@lists.infradead.org, linux-sound@vger.kernel.org, David Lechner X-Mailer: b4 0.14.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250206_144834_528584_466916E7 X-CRM114-Status: GOOD ( 10.67 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org Reduce verbosity by using gpiod_multi_set_value_cansleep() instead of gpiod_set_array_value_cansleep(). Acked-by: Ulf Hansson Reviewed-by: Linus Walleij Signed-off-by: David Lechner --- drivers/mmc/core/pwrseq_simple.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/mmc/core/pwrseq_simple.c b/drivers/mmc/core/pwrseq_simple.c index 37cd858df0f4d7123683e1fe23a4c3fcd7817d13..4b47e6c3b04b99dc328a8b063665a76340a8e0d0 100644 --- a/drivers/mmc/core/pwrseq_simple.c +++ b/drivers/mmc/core/pwrseq_simple.c @@ -54,8 +54,7 @@ static void mmc_pwrseq_simple_set_gpios_value(struct mmc_pwrseq_simple *pwrseq, else bitmap_zero(values, nvalues); - gpiod_set_array_value_cansleep(nvalues, reset_gpios->desc, - reset_gpios->info, values); + gpiod_multi_set_value_cansleep(reset_gpios, values); bitmap_free(values); } From patchwork Thu Feb 6 22:48:24 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lechner X-Patchwork-Id: 13963978 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 146B2C0219B for ; Thu, 6 Feb 2025 22:48:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/k5FPH38Hnp+a2048IsfzuL4hym2p2gsbtH7VmoZ5Tk=; b=igypjbgbIwhsRI 9oxT3FOzotCU7GM+f3MWoxWBe4FoiTYX8LgVlz/SNwlYs96AabCSHOoOFzMMM64vuSRMfIADXNA8H 4yhUTLt2nGg4mor2Xw2uKYeWTBFo9d5jxYaymfvt3qJrif8krV6/IdLCjzcWkhybVkiw7GRQGAYir aXeU3ipB9DfFfZPT/0sv2r2I5BnrDFC69G3xac0WtBjCapNgiNwuHeGRkSQZGlFH8zfbDgCwgj06E W22RlTyaUOM5cpwyuVDklu7iehhbOVxluNHKRvvksirxRIJZOBOStqzxPUWvawyC62cgJ5++2taS4 hagKXu0fZlgtmEVFebmA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tgAfm-00000007iQq-3TFH; Thu, 06 Feb 2025 22:48:38 +0000 Received: from mail-ot1-x335.google.com ([2607:f8b0:4864:20::335]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tgAfk-00000007iP8-07li for linux-phy@lists.infradead.org; Thu, 06 Feb 2025 22:48:37 +0000 Received: by mail-ot1-x335.google.com with SMTP id 46e09a7af769-71e181fb288so995338a34.2 for ; Thu, 06 Feb 2025 14:48:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1738882115; x=1739486915; darn=lists.infradead.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=/aqCjYxf4gSpR0G6gRQq6zdrmHAVbQWmkyM76ZxN2F8=; b=x/39aebDBNYRCTEfstUKSRJ086Re2w7yDegBDRw0bypgf9AMcsjLgD++4lly+uioSM MAKMDUNJfQYv8Ja22YRhxzne5lh1pQW3b8bKz0ZS1gV9iXaG3cJ85h++bQp4RES5+6LL D10sHfQYVbvyW2nx5SzApUIdxlCgYoquRsMpvVi6f/uguDuq567GsQucbCxBJV8wj/Xb f3O/BDl1RZw1O1efhuVV6uU+xS1D7i9kypoN8mA7KKqHsQ0XbobatTklqEI3ijeX7yK4 cEJ5Js4yHECV5VtxSJWrkfxFqyEyudqFbzjQu0ETY3n09qZGKH7ih0ceZBVL7N0KNb5D mQ2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738882115; x=1739486915; 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=/aqCjYxf4gSpR0G6gRQq6zdrmHAVbQWmkyM76ZxN2F8=; b=YwbPx9cI9LgNQOHwKhFfHMsE/4a93nVLdqm1imlC8O/Vgxuh36XFmtgfAIzGAOvf9g M4ktoVY2jQEFXxORKaLOs70VookdccwqQaQoMYi3ch+CdSvyLR8HBkaHvPNKbuDlyzEs IJDtru+SRCHamCwjYQ5k+cLvSBV27Ry5IGmtNwYag7t6f8/mXylk/j8Nn+Yi9gUAHuei kZsr+laAy/kBADFKZa/CF8JXNzL/yxyNyx6El2+JnvE6yyjGOtW2n8I0osji82CbVYoO zZ9Oxs8dxUtEGbtaxD5lfVB2JZJQ8brM9va9TTLVZAIvq3cv4lO8IvqrM++zkkv1uA+n a5CQ== X-Forwarded-Encrypted: i=1; AJvYcCVu2OIB0AoTl4iEUhUWalN3LgOA47N6ALsUna+5U1U9othiz0+6Yune9QGM3PM4q3UiLdScM5iY0/Q=@lists.infradead.org X-Gm-Message-State: AOJu0YwoCcd6LDVN/4yBinR9el7WXTn6xi3gIIOv9nK6hyypDoLhKclr Lo4Go2+Rkqu1iuYFRhMyhMhziUcVy42EFSScChFHe9tIoo0snXhXbEGtkPYq6kI= X-Gm-Gg: ASbGncs8UvOPv5seGpPkjkiTgtKmldvYWBA4dY37ba8BTUvBaAqfrfOQA6W+rfkcMWb HCxhOyfpu5jIxTRmrJnzDVQar33gubT0gzGIz0jqBE9KVLA17fGQKYYowr4hTUyvEJfv/C225bt 2y4BIX0b/D3zwwVSISz3YcBmU8QjKdi0WEqqaIXmynu9OV6nd0cz1VmOszYJ9infm5C+dayxRWx WTAB8+lLTbf/g1xetqvaaMrWVa00atigLRAZ1mmxvBNfKo+0pKN4a22v4txOcSG5Fy9E1SBnhFX qxPPSmy7Svr00hPvG8lsKrfR6oofNpZGGgCARBSWkj6iSGg= X-Google-Smtp-Source: AGHT+IFi5pOT04kq25kPl4tFke6cDrSG8LtrrGuNrjvHOS0CkDrwzGgg5qxvsBSG8EfBe8D1EHBqsg== X-Received: by 2002:a05:6830:d81:b0:71e:17c1:45e with SMTP id 46e09a7af769-726b88883famr823900a34.21.1738882115069; Thu, 06 Feb 2025 14:48:35 -0800 (PST) Received: from [127.0.1.1] (ip98-183-112-25.ok.ok.cox.net. [98.183.112.25]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-726af95bbb5sm510986a34.41.2025.02.06.14.48.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2025 14:48:34 -0800 (PST) From: David Lechner Date: Thu, 06 Feb 2025 16:48:24 -0600 Subject: [PATCH v2 10/13] mux: gpio: use gpiod_multi_set_value_cansleep MIME-Version: 1.0 Message-Id: <20250206-gpio-set-array-helper-v2-10-1c5f048f79c3@baylibre.com> References: <20250206-gpio-set-array-helper-v2-0-1c5f048f79c3@baylibre.com> In-Reply-To: <20250206-gpio-set-array-helper-v2-0-1c5f048f79c3@baylibre.com> To: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Geert Uytterhoeven , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Ulf Hansson , Peter Rosin , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Vinod Koul , Kishon Vijay Abraham I , =?utf-8?q?Nuno_S=C3=A1?= , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, linux-mmc@vger.kernel.org, netdev@vger.kernel.org, linux-phy@lists.infradead.org, linux-sound@vger.kernel.org, David Lechner X-Mailer: b4 0.14.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250206_144836_074918_860EB480 X-CRM114-Status: GOOD ( 10.69 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org Reduce verbosity by using gpiod_multi_set_value_cansleep() instead of gpiod_set_array_value_cansleep(). Acked-by: Peter Rosin Reviewed-by: Linus Walleij Signed-off-by: David Lechner --- drivers/mux/gpio.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/mux/gpio.c b/drivers/mux/gpio.c index cc5f2c1861d4a22d984bcd37efb98dd3561ee765..5710879cd47f89b6ef4458d6b4419a1fe9ad349f 100644 --- a/drivers/mux/gpio.c +++ b/drivers/mux/gpio.c @@ -28,9 +28,7 @@ static int mux_gpio_set(struct mux_control *mux, int state) bitmap_from_arr32(values, &value, BITS_PER_TYPE(value)); - gpiod_set_array_value_cansleep(mux_gpio->gpios->ndescs, - mux_gpio->gpios->desc, - mux_gpio->gpios->info, values); + gpiod_multi_set_value_cansleep(mux_gpio->gpios, values); return 0; } From patchwork Thu Feb 6 22:48:25 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lechner X-Patchwork-Id: 13963979 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 52431C02194 for ; Thu, 6 Feb 2025 22:48:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0tAvXx9N/0PdLKCFUMbf7rVpPTIxlczjmFSu1d/8Oi4=; b=ikjvh97ckX8KPl kk2DJIZX/TpPirMGPdkRCfryVwregX3pt4ExxCFL15/LDHykwuuc4JGa/TP87l3EEvDsx8sw6uKu2 tDjyv62i11uAq3PT7ojtbQiXIlL/yLw0aQ5E9YdZs9xvmD47Lu++r0d/hCQFK14ZqiE8OUvNZBNSY h5deH4f+YyGuYoMdJS9HEzphdcG2duZQOgNN4+K134dOzHHCXsHA3hwklb+vW5QdJWbxom1SYUFgJ ldBmyUwqLOecedcZLoieFLi+UJISwgxQlmfHmPxnkCnCZQo2T4TLAflLZLtbMg4ZLx3oxIcuOW8U7 kspdX1UK/jygYQ9Gjcrw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tgAfp-00000007iSU-0MJP; Thu, 06 Feb 2025 22:48:41 +0000 Received: from mail-ot1-x32d.google.com ([2607:f8b0:4864:20::32d]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tgAfl-00000007iQ3-3VT3 for linux-phy@lists.infradead.org; Thu, 06 Feb 2025 22:48:38 +0000 Received: by mail-ot1-x32d.google.com with SMTP id 46e09a7af769-726819aa3fcso912412a34.0 for ; Thu, 06 Feb 2025 14:48:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1738882117; x=1739486917; darn=lists.infradead.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=wW6RHWEtayZ55WpdhtLO2i1JoETOot8MdB4MGkvPArg=; b=XK/2+DILAboBQMyGDA+RWvMRmbEJ98FORAHTZ/Q4nuB4KLip8Df76pwuaSkt75Yobf E8bdJE7dvSYG9xFZZ+A9zI0Y2lm4gJ86WSA2SN2iezmgPgMz2gpLJGZ6L++kH0vGnZ6C MMVIUNzMcKpS3RlKsfxG4UjMGZCSGXHA8qjFRsnoexfMrUifvKa9yPBTGcvtVQ0xhJfQ Pcvztxz5j3OqA2eRNcKdXfTiNoggRuMlZqJHHOiBcrKMPQWUkzx1dpx6CAGrcGTeCzp4 ZqotooqjyHQt+3NiRVVWkRRF2xhkbJqMBNv5Iz2QGKESC0X1Wth6cIjAqlq/hBlFlUNF IXog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738882117; x=1739486917; 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=wW6RHWEtayZ55WpdhtLO2i1JoETOot8MdB4MGkvPArg=; b=LZmvC0lXv9SaNWXgcbXuFxWMJ+GBMwQ7tEZPrEsvNCOsG0FLlC9oaHrxQSdclg3+qR +3nBwz1zP9E70vHiF6oQFQWFoeJ0AgPN18LzuxBtanzSyt2Aw3nCsjinLmIvTspbiuut HA6MJH24S15Pe/bNRH3aZStSOjoHS0bjUx2oLP0pv+AtRfHttodzBbH70DmDcR+eo6l4 10fIyAr/g/FtgCHfFdQw0yU0K9B7PduXIKnSsedZiNQc+VVRpLuMqQHnY/X0iK/uMEHZ Fyi1xeuz5zgzr2TriGUUJXL3kMgbubozgSw/sBO9xVnOBnP3AQ7Mjw3Yg9WB/pyfdDUc /7wQ== X-Forwarded-Encrypted: i=1; AJvYcCVEib6tuPd08Brz44tnORhRWII9qTEgJZUqt9Rxv8WB94YEHj1t3rkzZwuGvPYmOFQEhuh1Edpb2jk=@lists.infradead.org X-Gm-Message-State: AOJu0Yytj1LJ7LvTGnKaBzVRKBqVILUHCmgd2rJdpbDMMiqRqePiQNLh l/E8Wx1nHNYERxpPvXNKMmmlqc6CaJ499yF3zXmGfs9bamJ8Dy1a0KUcpaPiirM= X-Gm-Gg: ASbGnctzDUiBpifPRgCl1+PJ/NIT8TNYbRC8VlMwqMHlPu73Itwv816o8yxsruoDmrg 64d1ZAYHZv34eLXRMorGF0JQqK0iHoQ4WIvKGX1EJPprSzVhme8bkOLCBo0y8YKTlMtpTJQ+PyC uoMy+HhUIMpMy9I+geG9uWTQHyYGLPNAIY+2gL3oEt4szsWwUpyU7VIHq6uJ1tLFp03igRLDSrZ 0VwQ6kNC+Hlom80IgxrKD6wrP+RQgMke59OXldnC8lZubldAyHGS7guSnr3pkTg0YRC6sVy9yPW I4F0iXga/Gicqe9gerQNW2Muh3DmpnlfzL8ejpiWhWY8CsU= X-Google-Smtp-Source: AGHT+IH8zx5vDbhBOU+RiFLjmMV8uSugiz4ArRiuueUcFuxbcCISDHEvqYTZqWFApQPLnbiuZHKf3g== X-Received: by 2002:a05:6830:d08:b0:71d:b6a9:7489 with SMTP id 46e09a7af769-726b87dae1bmr640053a34.7.1738882117199; Thu, 06 Feb 2025 14:48:37 -0800 (PST) Received: from [127.0.1.1] (ip98-183-112-25.ok.ok.cox.net. [98.183.112.25]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-726af95bbb5sm510986a34.41.2025.02.06.14.48.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2025 14:48:36 -0800 (PST) From: David Lechner Date: Thu, 06 Feb 2025 16:48:25 -0600 Subject: [PATCH v2 11/13] net: mdio: mux-gpio: use gpiod_multi_set_value_cansleep MIME-Version: 1.0 Message-Id: <20250206-gpio-set-array-helper-v2-11-1c5f048f79c3@baylibre.com> References: <20250206-gpio-set-array-helper-v2-0-1c5f048f79c3@baylibre.com> In-Reply-To: <20250206-gpio-set-array-helper-v2-0-1c5f048f79c3@baylibre.com> To: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Geert Uytterhoeven , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Ulf Hansson , Peter Rosin , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Vinod Koul , Kishon Vijay Abraham I , =?utf-8?q?Nuno_S=C3=A1?= , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, linux-mmc@vger.kernel.org, netdev@vger.kernel.org, linux-phy@lists.infradead.org, linux-sound@vger.kernel.org, David Lechner X-Mailer: b4 0.14.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250206_144837_876931_7634DC20 X-CRM114-Status: GOOD ( 10.97 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org Reduce verbosity by using gpiod_multi_set_value_cansleep() instead of gpiod_set_array_value_cansleep(). Reviewed-by: Linus Walleij Signed-off-by: David Lechner --- drivers/net/mdio/mdio-mux-gpio.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/mdio/mdio-mux-gpio.c b/drivers/net/mdio/mdio-mux-gpio.c index ef77bd1abae984e5b1e51315de39cae33e0d063d..fefa40ea5227c5a35d89ec2c6f95c6668a2470f6 100644 --- a/drivers/net/mdio/mdio-mux-gpio.c +++ b/drivers/net/mdio/mdio-mux-gpio.c @@ -30,8 +30,7 @@ static int mdio_mux_gpio_switch_fn(int current_child, int desired_child, values[0] = desired_child; - gpiod_set_array_value_cansleep(s->gpios->ndescs, s->gpios->desc, - s->gpios->info, values); + gpiod_multi_set_value_cansleep(s->gpios, values); return 0; } From patchwork Thu Feb 6 22:48:26 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lechner X-Patchwork-Id: 13963980 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C77A9C02196 for ; Thu, 6 Feb 2025 22:48:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=J2GMJRVXUlJ6uxL+2YFdZuz7FQgT7AmzR8OsNGToXLM=; b=dSUUjLhkBLJnEZ I2LMwQpDerARIsV4DNxiVYD3mkmReIAB512KubOhDxeVv8HnCvb5nVTGqz+Qn6x7ja7O871awW/Q4 7trM/mU29ZA80Ev9ydSYyT3Su5p6mQhbxgoTD9RcoT1wWpz6xiO6uJwq0odaiF6pVwWfsD/pE4qSp UdtNTg09AABoctNf4mbnpjjYiD3jrIVkZIZwJ/+nicU8TpfHy0MPaR88O9NQFPg+mMn+tqHAIY71W FrYI09L95V8JiXddDnywYFL+2SSvxwdExUT4Y8si8W4Ys8pwfPtyKzLO+UN5e5CU9ewNyCyE0SL2o HMrqFZ6yrqoMOuwT4d0Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tgAfq-00000007iT2-2Ntx; Thu, 06 Feb 2025 22:48:42 +0000 Received: from mail-oi1-x230.google.com ([2607:f8b0:4864:20::230]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tgAfn-00000007iQl-1Owq for linux-phy@lists.infradead.org; Thu, 06 Feb 2025 22:48:41 +0000 Received: by mail-oi1-x230.google.com with SMTP id 5614622812f47-3eb98b3b63dso379178b6e.1 for ; Thu, 06 Feb 2025 14:48:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1738882118; x=1739486918; darn=lists.infradead.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=Rir37DR+dGjXzV88JkfAUftf+GWLKbTzx84djPKNaJM=; b=OVr3HfDGdUKRH50VAotkvfSRFTpIHVCqUCgEHZkZKhn6Mp/DMj82/bWzoI4g1ZeGJb MWh7yxjm6HprJmzHmUI/SkyFommWpK+ir+JBKujXMzOi4sFLB3CAaI05UwMP1PexvqsN YhLRtoNk7o1I61W8cEDHrKjqfKzM3DNGYIyijUPxxdzu8hNUElbxbuogGdvH3Y6Lw+Yz 3Qly6T0G7uX83LmqveIA1X1kWOUYKze4vfkymB6cmOx28tLvuRis9V7lyY0UvWy0ahRL a/cHwx5tnAUDxndDd/iCbmeYi4XUZEltTfO9HrifV0wzARrHgyRsiKwlnmyDBvXRMX3B JWWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738882118; x=1739486918; 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=Rir37DR+dGjXzV88JkfAUftf+GWLKbTzx84djPKNaJM=; b=H2FJmpNk3b25lJS05q83Ay6NoRXVhHc9DqMGYSB78yZrQMCd9GifGH9otfR1ZS1FT1 OUsxBI5+3JmWyrtnonaaJ3zpXEh7QMMVIHUosdX9svW13fblvCCNEpHF4O5Cj5zm8mlc 91nSrEvkFxDOPulD7nuO6cvBcZuOo5fDMEpxE1RdNOmMOPbn3ZDBt8QmP242By/kEZnY 7UU2vVa2vl1jF97O8tUOuBjmRY+u6Q21YRhoEyml/OFzrVOgFntdZUFEZef58h0jb7+1 20bdgzq1G4Gmr6kLcMcSt5Janr2/rM51PD0ogQXim09eawLo4o/RQpreLtJrNS2+Ty0N 3k5w== X-Forwarded-Encrypted: i=1; AJvYcCVzXORVzWcJw/dbNspH4RXdCF0KyAfqFDPma8ofJ0uGBHW4+NFxyeN3TBSyifWp37zg09ytFCS3uOc=@lists.infradead.org X-Gm-Message-State: AOJu0YxVmZoT+uMyrL1JxpGYbgneigusIvoymuUJcCHZI1IX2zxc41Ki ZAtWilWLSj2gxsxoaM82w/unZ3kzN5WPnjuvI0DqXp9+yRPgQKv5GwFEjlukV34= X-Gm-Gg: ASbGncscGOl01OMHa1AvsTOYEB3M329jY5kF0JlCsVOpHFDP3LZo/6mjpaHGzKkgZoa pp2TbHjtYbe/rkp+lIPygrZKTqns1pMuLwkqc9U1WgxjXIPLb1ii00MZymetx0f5JUugNXnKc+b r57jd3JiA9nJmyUq5NpLYAHkUkvkhK7BbZEy+7fyBoIevfK2Urk5wRzwpfNc3GeNvsHM2G4Gelz u3xd1niG/J9xciIjWNOaMAiQIw1CuN8xzEuX5IzVZ7/95eP+ra4CLZZ8aIq+gw2ZAEvGh6+lqyX dfXYFP3H0doMyA0s4tLE8HULBKPmiSgrFKmttLRfNsugu4Q= X-Google-Smtp-Source: AGHT+IHg1dkR38vC+BOfsqdfTGHavmIhAar+M8vjgAZ97yt8yxkX/PgUDRgvY/W1hOK9akNHaGFBHA== X-Received: by 2002:a05:6808:2f09:b0:3e4:d4ca:2774 with SMTP id 5614622812f47-3f392318adamr932419b6e.20.1738882118361; Thu, 06 Feb 2025 14:48:38 -0800 (PST) Received: from [127.0.1.1] (ip98-183-112-25.ok.ok.cox.net. [98.183.112.25]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-726af95bbb5sm510986a34.41.2025.02.06.14.48.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2025 14:48:37 -0800 (PST) From: David Lechner Date: Thu, 06 Feb 2025 16:48:26 -0600 Subject: [PATCH v2 12/13] phy: mapphone-mdm6600: use gpiod_multi_set_value_cansleep MIME-Version: 1.0 Message-Id: <20250206-gpio-set-array-helper-v2-12-1c5f048f79c3@baylibre.com> References: <20250206-gpio-set-array-helper-v2-0-1c5f048f79c3@baylibre.com> In-Reply-To: <20250206-gpio-set-array-helper-v2-0-1c5f048f79c3@baylibre.com> To: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Geert Uytterhoeven , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Ulf Hansson , Peter Rosin , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Vinod Koul , Kishon Vijay Abraham I , =?utf-8?q?Nuno_S=C3=A1?= , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, linux-mmc@vger.kernel.org, netdev@vger.kernel.org, linux-phy@lists.infradead.org, linux-sound@vger.kernel.org, David Lechner X-Mailer: b4 0.14.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250206_144839_387391_051D6DA1 X-CRM114-Status: GOOD ( 11.46 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org Reduce verbosity by using gpiod_multi_set_value_cansleep() instead of gpiod_set_array_value_cansleep(). ddata->cmd_gpios->ndescs is validated to be equal to PHY_MDM6600_NR_CMD_LINES during driver probe, so it will have the same value as the previously hard-coded argument. Reviewed-by: Linus Walleij Signed-off-by: David Lechner --- drivers/phy/motorola/phy-mapphone-mdm6600.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/phy/motorola/phy-mapphone-mdm6600.c b/drivers/phy/motorola/phy-mapphone-mdm6600.c index 152344e4f7e44de0f8ab1cae6ae01a1f1c5408e9..fd0e0cd1c1cfb10fb55ed271e47b6a0bf857028e 100644 --- a/drivers/phy/motorola/phy-mapphone-mdm6600.c +++ b/drivers/phy/motorola/phy-mapphone-mdm6600.c @@ -177,9 +177,7 @@ static void phy_mdm6600_cmd(struct phy_mdm6600 *ddata, int val) values[0] = val; - gpiod_set_array_value_cansleep(PHY_MDM6600_NR_CMD_LINES, - ddata->cmd_gpios->desc, - ddata->cmd_gpios->info, values); + gpiod_multi_set_value_cansleep(ddata->cmd_gpios, values); } /** From patchwork Thu Feb 6 22:48:27 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lechner X-Patchwork-Id: 13963981 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0FDA3C0219B for ; Thu, 6 Feb 2025 22:48:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4pYHTh0GgHhmzhCgd6Ki2KjaS7jWnCpqpAbL/+di8zI=; b=4yIlk3BIHPOf6g /Pwgg3sgp0WJMEoUS9au2q+4VeaSJFwEeYmoUBPLE0AJ9zujzmK1ZjOciOrLnN9i2W9Wa7FWz11xl 9i2e7beBY1UhuAdKSTmDbsKAdHNQy04ov2Qek7RAUwyShLqsOb1xTpmPOhdhs9rP3SXARfGEpaPtf l60466gz6sWU0Ksky00e4PK9HbQVeu5YOzem7J9+RzAmCCWSoWcd6+caOg6OqxmxYinLqwjvBIqZo 8FtSRyMAJYG/rLVWYP8q8q5Q/vn18ziJi1hjt2P6dF8YtTtdVvaTQuDlK0GWryTUDZy/G3ia423bL aJm5FpkPAA1sb1qsfxFg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tgAfq-00000007iTJ-3Rok; Thu, 06 Feb 2025 22:48:42 +0000 Received: from mail-ot1-x32a.google.com ([2607:f8b0:4864:20::32a]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tgAfo-00000007iRy-2Ydz for linux-phy@lists.infradead.org; Thu, 06 Feb 2025 22:48:41 +0000 Received: by mail-ot1-x32a.google.com with SMTP id 46e09a7af769-71e3eb8d224so492432a34.2 for ; Thu, 06 Feb 2025 14:48:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1738882119; x=1739486919; darn=lists.infradead.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=Zrl0lG0s99SDBuGZ/+AcMLJIAJmPLy1NCd/dBoX8jU8=; b=bHIAdv1JPZ4ujx6JVQgUqeCp3MJlPKejIKv1qszS5noT6iZupMheZYH2ynnDV9d+PP x0+WlgHEXlNixKX99IWzYBYso8Ol6FphkDpPmiyqLGwLlknJbxz83QMzNysIYNqrP8wR VCVLJDz0nXo72m/v9KDr5zXHIj+7qiCOiVKTjkqTZj6XVTEP3RowtNNWzFuNUs3BSu7U 3vImNZ4aMQUGQPjY06SeQFMegtvwx+CIVvth8Bhnn16iIHF9cOVpS0ReB6hZko3MfX49 37yAPFMCNHFenYy7PZdjA3ue4yEX/V/55WW92haXxQbjQg6pllK6mhqPBVQ9PEk3bt1X VRaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738882119; x=1739486919; 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=Zrl0lG0s99SDBuGZ/+AcMLJIAJmPLy1NCd/dBoX8jU8=; b=pHHegC3Cjm82RRLznb3r6zB8I4GGlxZ0OutaaNLHixP7Qd/ccdzIM0ElC0TBTUGbth hPpVnVQSOqTLlZWtO4NgwahvF6r4XlK9i5PC/+23Msh8KX2vwaCQPfPme1ttwiCotJuB MCwed/CITAYZFV2sDxAiMZo5l0r6QnmBbZRV/1kqif6mjsn6tRxoATzUJ6zymb1I/jEF qUSuQaJISFtBfmsnJRmt6b/hHZM7u4kdqoUGsaGi5z447VJTSj2vgqyQhP/epA2reeiB 6fDgAVJzn03YMH/2k0Oe+iMnoVo5zdh5CIyv3RrhY60/giJlvu3SFtNB9U5oQYULhsjH /oTQ== X-Forwarded-Encrypted: i=1; AJvYcCXvkCkZ/TR+jRHoYxIYFMlEbyizmYo9qIAuw8wU/R4SKoxs4LxPdlYhCK9KtaTtVd6gulpHR+u3nzs=@lists.infradead.org X-Gm-Message-State: AOJu0YwG8HjVDiTMX5iWKO1mRicfBZHVaorITOTNRHD5paFUJ37hfN0N +Yn8HOHFej4Epbb2jAmRh2IadISy2Ks9IXC5i6v4MAJwh9sYKuewMbAglnVtlYE= X-Gm-Gg: ASbGncv5YOSqu52l107RGPD3w1gA2XiqJT0sorY4yc21xpd4/NOjqIf/Kb0rGK2foll DNCCkrODLHFUR5dAXWFsQ/9tACIvcPLfM7Cx7i+QNc3RzhUWerr8C6hCCMJsI3gyOAe86tzXz75 YhOqjy5QNuKoIobn0hMAMow1QZX3hHeCzk5GJGpxHrXFH2XLiQOMMUs/Avad8IDV8OCKHZrX8Ve eStJNjaRtf5iGSlOWqm+mBTVIVYmItes1EO2j4z17Nxyo3Ptecvlj5j7YyN5TqJ1cd2evNpFzGZ nc3CdGJEIboeHvecqqanEoL8PC1S+MMM71XzVJ02qF3avL0= X-Google-Smtp-Source: AGHT+IF6EkhBBGtZyNdnec2UQucqxt5fakVdlz2IO8AnBCKVXc9lOTpKIIPxZD3f0MWNAAb4im2E5A== X-Received: by 2002:a05:6830:6819:b0:710:f38a:191c with SMTP id 46e09a7af769-726b87c732bmr566366a34.11.1738882119510; Thu, 06 Feb 2025 14:48:39 -0800 (PST) Received: from [127.0.1.1] (ip98-183-112-25.ok.ok.cox.net. [98.183.112.25]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-726af95bbb5sm510986a34.41.2025.02.06.14.48.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2025 14:48:39 -0800 (PST) From: David Lechner Date: Thu, 06 Feb 2025 16:48:27 -0600 Subject: [PATCH v2 13/13] ASoC: adau1701: use gpiod_multi_set_value_cansleep MIME-Version: 1.0 Message-Id: <20250206-gpio-set-array-helper-v2-13-1c5f048f79c3@baylibre.com> References: <20250206-gpio-set-array-helper-v2-0-1c5f048f79c3@baylibre.com> In-Reply-To: <20250206-gpio-set-array-helper-v2-0-1c5f048f79c3@baylibre.com> To: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Geert Uytterhoeven , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Ulf Hansson , Peter Rosin , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Vinod Koul , Kishon Vijay Abraham I , =?utf-8?q?Nuno_S=C3=A1?= , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, linux-mmc@vger.kernel.org, netdev@vger.kernel.org, linux-phy@lists.infradead.org, linux-sound@vger.kernel.org, David Lechner X-Mailer: b4 0.14.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250206_144840_651150_7D295DEA X-CRM114-Status: GOOD ( 10.60 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org Reduce verbosity by using gpiod_multi_set_value_cansleep() instead of gpiod_set_array_value_cansleep(). Acked-by: Mark Brown Reviewed-by: Linus Walleij Signed-off-by: David Lechner --- sound/soc/codecs/adau1701.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/soc/codecs/adau1701.c b/sound/soc/codecs/adau1701.c index 291249e0a2a32df7dde81904dce2f6be143fc2d7..6876462d8bdbb41d551f776c2d7fe6ed46115fa1 100644 --- a/sound/soc/codecs/adau1701.c +++ b/sound/soc/codecs/adau1701.c @@ -325,9 +325,7 @@ static int adau1701_reset(struct snd_soc_component *component, unsigned int clkd __assign_bit(1, values, 1); break; } - gpiod_set_array_value_cansleep(adau1701->gpio_pll_mode->ndescs, - adau1701->gpio_pll_mode->desc, adau1701->gpio_pll_mode->info, - values); + gpiod_multi_set_value_cansleep(adau1701->gpio_pll_mode, values); } adau1701->pll_clkdiv = clkdiv;