Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp312887pxy; Fri, 30 Apr 2021 06:07:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHiJKP7Ntgi8v7yLUqWnsvkTQv3kXajHJGtRu8pOLJ31Y1CpbwzjJctdzsmJVAiSQQ8yAo X-Received: by 2002:a63:540b:: with SMTP id i11mr4697120pgb.44.1619788074127; Fri, 30 Apr 2021 06:07:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619788074; cv=none; d=google.com; s=arc-20160816; b=1BzjYDMaMEt71JMcWzfgGi+vMyfEyo2PEIGDnOPgpZgCHUgYsBkS9BanvJo8ylNYq9 0gJZXihngxpg2iYjTk9CuUW7Lr4NjgRiuSmYMx0SWN4ObreIypXFxTmj+/77LmhTZ1r3 dJwChKhbj9C++hRVwgNpH1cRmRMkC0GeBwo+/qJ1N/mCtlLL5LNIXUMS+AIj4Tax7HFh Ah+5SeuGE7PDF+dRvOOsB/3IfiBf1M0jQLOBhDFfK6wMq+Xm3ulrZ6ZMehuqCV9fVD5J adCdk5VN9Bawyp6fAk3TIB+aUQKt5LwfMglmgDHj0iGOQEcWEKYrIpfpC+cR45GmKigK F5iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=M0/f9T9xCQCVQ2k6HHiJrTlUxlM31VrlnC9F+1WUCPE=; b=kus6vzadeiA5UmSDckMItdrPHQxglTmW2tUKZHLWQKElLxlHWxxyUcJt5d+hEEVSlO 4W/QCdGSiugGuUWjZ8uvQOj9aqKqa/Y47tbT/gpUJyrEm6sMtHA3AbhQhRqB9vQSkhF9 z+QyN3Ns+Kec4nv8uXAGqkE2RCZMt5Ua2POClOl+JBAAf/WtocL42fZhHm7m1zGMyRca lVNFx94P5DLs2jnEv5ERVGYCxKniojlYbPzjaOB0S71D88S/yTvzvp0pEYin+fgoOjO1 xDbrwVVBvwX5heXF/lpgIa87YF8erhq0fUJh0bW9ElIFGuQ8m537BPm8F7dR5Lsi/tcP /K7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=PIZuxJ1B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e2si3632564plo.6.2021.04.30.06.07.38; Fri, 30 Apr 2021 06:07:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=PIZuxJ1B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232209AbhD3NHn (ORCPT + 99 others); Fri, 30 Apr 2021 09:07:43 -0400 Received: from ssl.serverraum.org ([176.9.125.105]:36599 "EHLO ssl.serverraum.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230020AbhD3NHl (ORCPT ); Fri, 30 Apr 2021 09:07:41 -0400 Received: from mwalle01.fritz.box (unknown [IPv6:2a02:810c:c200:2e91:fa59:71ff:fe9b:b851]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 8342722255; Fri, 30 Apr 2021 15:06:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1619788011; 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: in-reply-to:in-reply-to:references:references; bh=M0/f9T9xCQCVQ2k6HHiJrTlUxlM31VrlnC9F+1WUCPE=; b=PIZuxJ1BsOlf+dds+IC60FwR76QL3YGqa3CaNT1CysjkS0Eh7I3Dmzk3mnwxp0079zN8o3 K3k1k5ULuatQWpG1lPThGygZolgr7Ag6FS46FM/17kPpQshOut1uSQ755EZ+gIcm9UBOlJ wRIh0RLIQ5umjQuG15Eleigd66lKTaQ= From: Michael Walle To: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org Cc: Mark Brown , Greg Kroah-Hartman , "Rafael J . Wysocki" , Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Michael Walle Subject: [PATCH 2/2] gpio: regmap: use new regmap_might_sleep() Date: Fri, 30 Apr 2021 15:06:45 +0200 Message-Id: <20210430130645.31562-2-michael@walle.cc> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210430130645.31562-1-michael@walle.cc> References: <20210430130645.31562-1-michael@walle.cc> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/gpio/gpio-regmap.c b/drivers/gpio/gpio-regmap.c index 134cedf151a7..706f6c34696e 100644 --- a/drivers/gpio/gpio-regmap.c +++ b/drivers/gpio/gpio-regmap.c @@ -259,14 +259,7 @@ struct gpio_regmap *gpio_regmap_register(const struct gpio_regmap_config *config chip->of_node = to_of_node(config->fwnode); #endif /* CONFIG_OF_GPIO */ - /* - * 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(gpio->regmap); chip->get = gpio_regmap_get; if (gpio->reg_set_base && gpio->reg_clr_base) -- 2.20.1