From patchwork Thu Jan 5 15:06:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Walle X-Patchwork-Id: 39639 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp347286wrt; Thu, 5 Jan 2023 07:11:25 -0800 (PST) X-Google-Smtp-Source: AMrXdXuCDl4n4mAvvUInIdVPw4MvpWKloOa3MPtWziX9G0/Uc6lUXaEgL13Z8HKqw3SQ8wJ13x92 X-Received: by 2002:a05:6a00:bca:b0:581:4ab0:abcd with SMTP id x10-20020a056a000bca00b005814ab0abcdmr37413782pfu.14.1672931485064; Thu, 05 Jan 2023 07:11:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672931485; cv=none; d=google.com; s=arc-20160816; b=u7DS4MTSAh3lFmXU3RKe04GvqnLI4LsUunLtv04wFH4pf5kyiR2JfqbeFI2pN26utd DB9GLigkJZa0LYi96IZpAEnpUpVdwCGJwDF6+SWaHzg8qgDOhNqvgdanDpel8oe7ExkK rwezru61MRlLlZDVlSvSUKJIuP/WAJssopZ0PRyo4A/EW4ImlH1xDF0Jvw91BSWv/XiB zMWhkA29zDQlHutw9oTMcBiywGyNi5OVY+WdD05/j5n8EgeeTEUqgn3ok7xS8FUC85KD QeGrHC4mJ3WqdedYxf25GJGfWlygT/ufi9LFkXQjUY5YvE+D6yQxvQtU6NMj23hUZTWH qG5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=EF2eIHMM0/bse1Ygy2mGPcB63S0svTOuyeNiDsJqQR0=; b=v2XfasYox9xuQpKoeUb2XYuUiEBVpPK4OZxh6fI8z0jUMCBm2bfo52NCkaepLygu16 cAKlGkYBpZGx6/puZcH3WPaLzay2l6jroLjapXjyXlDwA2BnEuOvMrUSi5q4Rr21Fka5 Sn+G/nPEeZQP6M+fQ0N57mWa3wckjEYVIMyFbpOV9Hxt9vDfeyY94gTm9yblSWpbrRtj bDGalMrjZnX2jDIn7kLBibYx+VCW3A+beZUe4KwKcF43jVt46Oca0Ko28PMseQGy3KbD AzAPxw0flr5T1mvu0Y+2+9a+IMD4VDlmn+I+eFthsng0edLSssjF/8dK4S3P8nYVfhhx vbGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2022082101 header.b="AAhTa/Fb"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=walle.cc Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z11-20020a056a00240b00b00574adda7b3bsi38226473pfh.349.2023.01.05.07.11.12; Thu, 05 Jan 2023 07:11:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2022082101 header.b="AAhTa/Fb"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=walle.cc Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232589AbjAEPGU (ORCPT + 99 others); Thu, 5 Jan 2023 10:06:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231978AbjAEPGQ (ORCPT ); Thu, 5 Jan 2023 10:06:16 -0500 Received: from mail.3ffe.de (0001.3ffe.de [159.69.201.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB8534BD52 for ; Thu, 5 Jan 2023 07:06:14 -0800 (PST) Received: from mwalle01.kontron.local. (unknown [213.135.10.150]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.3ffe.de (Postfix) with ESMTPSA id 17F2075; Thu, 5 Jan 2023 16:06:12 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2022082101; t=1672931172; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=EF2eIHMM0/bse1Ygy2mGPcB63S0svTOuyeNiDsJqQR0=; b=AAhTa/FbXoBbqEkuWdx/tWRUaIz+T9vcRrK97PSApy0xwAuL8DOMyhlP7HbHm+9+9Oq3BV kWMVPZAfP5a2lSuaLbjdmdGt/hbr7JdTfLtg1sIEqVx7uSfIPSHRlLTx0K7Qlm+lpiJnHA EW/G5eNezqV9FatmpYoQ+6Jcy9UdE9NUDvrleL2sesw809zskILi/I36Knc84BrNeYx0pl 9TBdXLLMtP7re0uLzQ06Eh4R8OXXi0BHy7HIc7SSqWgsp8QZQmfvwK797IirshKZvDq+BY Jtd1QF9mJj0G4KLzd3JyCVfmFfuHLIwILRQKjlbJ6lmfoKWbBG1lydl2W46qUg== From: Michael Walle To: Linus Walleij , Bartosz Golaszewski Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, William Breathitt Gray , Michael Walle Subject: [PATCH RESEND] gpio: regmap: use new regmap_might_sleep() Date: Thu, 5 Jan 2023 16:06:03 +0100 Message-Id: <20230105150603.2810510-1-michael@walle.cc> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754195804593409173?= X-GMAIL-MSGID: =?utf-8?q?1754195804593409173?= Now that the regmap can be queried whether it might sleep, we can get rid of the conservative setting "can_sleep = true". New drivers which want to use gpio-regmap and can access the registers memory-mapped won't have the restriction that their consumers have to use the gpiod_*cansleep() variants anymore. Signed-off-by: Michael Walle --- drivers/gpio/gpio-regmap.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/gpio/gpio-regmap.c b/drivers/gpio/gpio-regmap.c index f907c9c19fce..fca17d478984 100644 --- a/drivers/gpio/gpio-regmap.c +++ b/drivers/gpio/gpio-regmap.c @@ -254,15 +254,7 @@ struct gpio_regmap *gpio_regmap_register(const struct gpio_regmap_config *config chip->ngpio = config->ngpio; chip->names = config->names; chip->label = config->label ?: dev_name(config->parent); - - /* - * If our regmap is fast_io we should probably set can_sleep to false. - * Right now, the regmap doesn't save this property, nor is there any - * access function for it. - * The only regmap type which uses fast_io is regmap-mmio. For now, - * assume a safe default of true here. - */ - chip->can_sleep = true; + chip->can_sleep = regmap_might_sleep(config->regmap); chip->get = gpio_regmap_get; if (gpio->reg_set_base && gpio->reg_clr_base)