From patchwork Mon Dec 3 21:42:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dinh Nguyen X-Patchwork-Id: 152782 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp7325867ljp; Mon, 3 Dec 2018 13:42:29 -0800 (PST) X-Google-Smtp-Source: AFSGD/XsOruu373+LGX8Jx3CknLqoWAVlBCwUD6tfs6aIRYQK36Ctstjs5pzs537wmuD20QOt3gw X-Received: by 2002:a63:f811:: with SMTP id n17mr15018419pgh.23.1543873348984; Mon, 03 Dec 2018 13:42:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543873348; cv=none; d=google.com; s=arc-20160816; b=t36LkCggx/pqEa4ORW51lF1hJ2ZUZwGqMtEW3XVzXL1M82v2vzhEiZYT0OzNzg0r+n bBoTj+tt4yh1j2G7m3AQ/r/xVW5H5jjackXKn0k6UQdxUE1gr63vUnNjcFBDygyFl9kR FvB+41tCaMGyhFGbLrJFr1l1zQYV9RQoL3E9xrFI6Yjvel3WJrTDNNRtEMkM6fEo4ujv bSQlWHeJGo6GSPrZU1x3PLja96F6G1A7iSj1NxM1rH5HR5p1gB2dQOMnbiQyJTCn4cw4 4SaPaZqOjeLUE/xiw02vSH4QhUrh2Tg/dGAV9YaVXy0FzdMkf4M8VOPmeiGB5Pa+b0hi uTxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=s9ZthRZtpT4M3RQm+6gvNDfhX5BRr1I8rvTYc/1B4u4=; b=VMQB5X2tsiaajnXKcX6yaJilKTNCw1Sis1Zoq/bgf/oVSZDAB067dkaiprEyCK333d XtNJnf3iX+tTP40dihOfBzabVYjWsRWv4NtC5uY39gIRIQBK/9JNHIC/libr7lfTdTko H6rWOqR8+0VlbLJ9WzgZm6jPgNtm+4e87FW/eB8H86ErbHUAvuVN+Nt7Rz2J0xWABKfm Ia9njZwziMUA2Q8Zj1Y7mCQWqHOiCFyznLJAhFD48bYjxkZl7EVZR+ng+HZRJ8NkNdwR Bt/teNtB/YPwLu7CZx3g3eBjWkkjlxWJhkaDxti2Zu5ZKs5vvRZ/fzzchCn4IC7JGowb 6YJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=r5cZD4R7; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bi2si14671055plb.200.2018.12.03.13.42.28; Mon, 03 Dec 2018 13:42:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=r5cZD4R7; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725952AbeLCVm2 (ORCPT + 15 others); Mon, 3 Dec 2018 16:42:28 -0500 Received: from mail.kernel.org ([198.145.29.99]:50000 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725972AbeLCVm2 (ORCPT ); Mon, 3 Dec 2018 16:42:28 -0500 Received: from localhost.localdomain (cpe-70-114-128-244.austin.res.rr.com [70.114.128.244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 989B620864; Mon, 3 Dec 2018 21:42:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543873347; bh=Hkn1cjzkI1ANGZkDNKdZsM21kWfqV4MsegA+Y5dZ57I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r5cZD4R7bbG5Pi/CrAOqPQJkiDY4u3c1h4Dk7Zv8C71UqFxxg1LhxbGphj1b6eW01 d2k7TMlN0yXECtUoE1q9UGuJG3p13BWWjNZB0pdTek0r4qqrcFs9kZUhxmkBz7cadp YXgk8BrXyZ7j/5jZ2MMiV6dIjbmBaC2eLEzlMofg= From: Dinh Nguyen To: stable@vger.kernel.org Cc: dinguyen@kernel.org, gregkh@linuxfoundation.org, sashal@kernel.org, Masahiro Yamada , Philipp Zabel Subject: [PATCH for v4.19-stable 5/6] reset: make device_reset_optional() really optional Date: Mon, 3 Dec 2018 15:42:13 -0600 Message-Id: <20181203214214.28612-5-dinguyen@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181203214214.28612-1-dinguyen@kernel.org> References: <20181203214214.28612-1-dinguyen@kernel.org> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Masahiro Yamada commit 1554bbd4ad401b7f0f916c0891874111c10befe5 upstream. Commit bb475230b8e5 ("reset: make optional functions really optional") converted *_get_optional* functions, but device_reset_optional() was left behind. Convert it in the same way. Signed-off-by: Masahiro Yamada Signed-off-by: Philipp Zabel --- drivers/reset/core.c | 9 +++++---- include/linux/reset.h | 28 +++++++++++++--------------- 2 files changed, 18 insertions(+), 19 deletions(-) -- 2.17.1 diff --git a/drivers/reset/core.c b/drivers/reset/core.c index e8cb31616c3e..188205a55261 100644 --- a/drivers/reset/core.c +++ b/drivers/reset/core.c @@ -410,17 +410,18 @@ EXPORT_SYMBOL_GPL(__devm_reset_control_get); * device_reset - find reset controller associated with the device * and perform reset * @dev: device to be reset by the controller + * @optional: whether it is optional to reset the device * - * Convenience wrapper for reset_control_get() and reset_control_reset(). + * Convenience wrapper for __reset_control_get() and reset_control_reset(). * This is useful for the common case of devices with single, dedicated reset * lines. */ -int device_reset(struct device *dev) +int __device_reset(struct device *dev, bool optional) { struct reset_control *rstc; int ret; - rstc = reset_control_get(dev, NULL); + rstc = __reset_control_get(dev, NULL, 0, 0, optional); if (IS_ERR(rstc)) return PTR_ERR(rstc); @@ -430,4 +431,4 @@ int device_reset(struct device *dev) return ret; } -EXPORT_SYMBOL_GPL(device_reset); +EXPORT_SYMBOL_GPL(__device_reset); diff --git a/include/linux/reset.h b/include/linux/reset.h index 13d8681210d5..61a0dda3f981 100644 --- a/include/linux/reset.h +++ b/include/linux/reset.h @@ -19,17 +19,11 @@ struct reset_control *__reset_control_get(struct device *dev, const char *id, int index, bool shared, bool optional); void reset_control_put(struct reset_control *rstc); +int __device_reset(struct device *dev, bool optional); struct reset_control *__devm_reset_control_get(struct device *dev, const char *id, int index, bool shared, bool optional); -int __must_check device_reset(struct device *dev); - -static inline int device_reset_optional(struct device *dev) -{ - return device_reset(dev); -} - #else static inline int reset_control_reset(struct reset_control *rstc) @@ -56,15 +50,9 @@ static inline void reset_control_put(struct reset_control *rstc) { } -static inline int __must_check device_reset(struct device *dev) +static inline int __device_reset(struct device *dev, bool optional) { - WARN_ON(1); - return -ENOTSUPP; -} - -static inline int device_reset_optional(struct device *dev) -{ - return -ENOTSUPP; + return optional ? 0 : -ENOTSUPP; } static inline struct reset_control *__of_reset_control_get( @@ -91,6 +79,16 @@ static inline struct reset_control *__devm_reset_control_get( #endif /* CONFIG_RESET_CONTROLLER */ +static inline int __must_check device_reset(struct device *dev) +{ + return __device_reset(dev, false); +} + +static inline int device_reset_optional(struct device *dev) +{ + return __device_reset(dev, true); +} + /** * reset_control_get_exclusive - Lookup and obtain an exclusive reference * to a reset controller. From patchwork Mon Dec 3 21:42:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dinh Nguyen X-Patchwork-Id: 152783 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp7325873ljp; Mon, 3 Dec 2018 13:42:30 -0800 (PST) X-Google-Smtp-Source: AFSGD/WWb0TyIGBOOnB4jD1i7jazBioG3yAxq4vLLO8DHIav6hQShXWJkVgdyJ6F1UUyVnxwzuMZ X-Received: by 2002:a65:4683:: with SMTP id h3mr14004669pgr.225.1543873349926; Mon, 03 Dec 2018 13:42:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543873349; cv=none; d=google.com; s=arc-20160816; b=K8Dk6aB06soXH7x1paO+BkCvmFUULYNKU5ZMrDgfX7KPL+uidL2ex9CJOhLLvKjW/s /UWXGWTtW2mlDQLOKo4epfZCHUjx3OES8ypP1k1SYj9ny47aN25t/AJxlEz/qefmFMuz DdZV9LvZx5siagx1J2+REV1JxiTGsZHMc/fxdBriybxvq85m3HVwFfNrUzyxLWEff3SG cFh2KnFzgWKQhJW8CIIZ/ogw22A/IOURh5dJEygfjk7WvPsdY9c+VFmDRbsK+WFSjocB kD+QkK5SwHhGthVAZXIYdQR0ylzfwOF+P6myWlYHMaFWIexwkFgFDp7hh3ovyE6YWUXo ToRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=MvZOIox5/7DJOF2EZKibAJzkUW01RoFSltyKhrUmvHY=; b=LD3o2FTYM1k7pEzW64E/8puYNk7Rtc/fTD0Gzv54sB8rjyh2zhH9tiONm/H8DHk9l9 VsURY1QOLkfUXMxHLur5gd8XFExl5SwavIHNBP5XIxzXCG7RfNY5OpqvBFiuqCijLn/p JkprfQ/ASPnwmvFzBY2Xp5WX2Rt6qLqeHMZdPjXRAeBAIUIMMirL8+a+GJqBQerpx7FT X7Js3i4Msa4c49lbVOjeYj3ebCAoATB5rpiJg3XvyUPXGRm0F3qXBo2fCMzKdensRQRy db9CD0piU6Hzvuk9JBWRJUfDz9NwOcQGsqM7fjXkoBRvjt2ZZd4N7tGTYe5SHju7hEec I/SQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PiKB1tIy; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bi2si14671055plb.200.2018.12.03.13.42.29; Mon, 03 Dec 2018 13:42:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PiKB1tIy; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725972AbeLCVm3 (ORCPT + 15 others); Mon, 3 Dec 2018 16:42:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:50022 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726019AbeLCVm2 (ORCPT ); Mon, 3 Dec 2018 16:42:28 -0500 Received: from localhost.localdomain (cpe-70-114-128-244.austin.res.rr.com [70.114.128.244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6FECD214C1; Mon, 3 Dec 2018 21:42:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543873348; bh=LxWYhn4Jp3ytIefqdvbxQru4iXG+rCTXjgAQsGFLTsA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PiKB1tIyxlxKUuumWaENRTltCL42oUgIbToEe+KJHOyp4hN24L8obcWPd8oKT2td3 x6NVa/+hzt2z3ly0EPVymzXxlIG6R/DGjZnM1cB3fb3nTtbx2sCPK4OJDl9AmV6sxB 6tivnVUQWi7FuAQDnM+ZEUPr9IaRe2N7vV2uYjkI= From: Dinh Nguyen To: stable@vger.kernel.org Cc: dinguyen@kernel.org, gregkh@linuxfoundation.org, sashal@kernel.org, Masahiro Yamada , Philipp Zabel Subject: [PATCH for v4.19-stable 6/6] reset: remove remaining WARN_ON() in Date: Mon, 3 Dec 2018 15:42:14 -0600 Message-Id: <20181203214214.28612-6-dinguyen@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181203214214.28612-1-dinguyen@kernel.org> References: <20181203214214.28612-1-dinguyen@kernel.org> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Masahiro Yamada commit bb6c7768385b200063a14d6615cc1246c3d00760 upstream. Commit bb475230b8e5 ("reset: make optional functions really optional") gave a new meaning to _get_optional variants. The differentiation by WARN_ON() is not needed any more. We already have inconsistency about this; (devm_)reset_control_get_exclusive() has WARN_ON() check, but of_reset_control_get_exclusive() does not. Signed-off-by: Masahiro Yamada Signed-off-by: Philipp Zabel --- include/linux/reset.h | 6 ------ 1 file changed, 6 deletions(-) -- 2.17.1 diff --git a/include/linux/reset.h b/include/linux/reset.h index 61a0dda3f981..7e99690dbc81 100644 --- a/include/linux/reset.h +++ b/include/linux/reset.h @@ -107,9 +107,6 @@ static inline int device_reset_optional(struct device *dev) static inline struct reset_control * __must_check reset_control_get_exclusive(struct device *dev, const char *id) { -#ifndef CONFIG_RESET_CONTROLLER - WARN_ON(1); -#endif return __reset_control_get(dev, id, 0, false, false); } @@ -255,9 +252,6 @@ static inline struct reset_control * __must_check devm_reset_control_get_exclusive(struct device *dev, const char *id) { -#ifndef CONFIG_RESET_CONTROLLER - WARN_ON(1); -#endif return __devm_reset_control_get(dev, id, 0, false, false); }