From patchwork Tue Dec 4 15:34:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dinh Nguyen X-Patchwork-Id: 152818 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp8202519ljp; Tue, 4 Dec 2018 07:35:18 -0800 (PST) X-Google-Smtp-Source: AFSGD/WYkj46F4camejI+TM61ko+0abaXp29Wa4kaY7rg4j1mAtWA3VDnkNHqa+R8KnDh+gM0/ru X-Received: by 2002:a62:f54f:: with SMTP id n76mr20498610pfh.59.1543937718103; Tue, 04 Dec 2018 07:35:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543937718; cv=none; d=google.com; s=arc-20160816; b=BZRf83PeRhJKEIsjD6/LwEXyEat29GSUXGDfwBNgVFa9mLE99HTfGRw1XxzyjXs/Kk zLYXZDX7a6bH9dQEmm7A8U35ZEBHZHxoL547okMsaqvxrcvETvw+DgnPpV1ak4aTpZNQ bmgAV3asTMGAuQRcoSbkaueW0ITOGLXhHj8Rr0ew6PJuNomobye968FvXrsi2AlsynqY DyVIHk5OcQr9Fi0o0Be7XGEmttisCqqB9mIzqSSzTx3yUXm6c/4oVmqZqOUqwigX4DOt Ft95boIPU+dhRVhb9sla1KiqgyMvT+XQf0bWkK2kyTsfxxpAoMY5ihZmgCO2dlkqQvTg i6Dg== 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=IRNkfgwoJydiZpD+T7fTmAcxJkJ3pge1vNiWYnaoKWcaDQcXjx8M8c/JF/6z9UiWOs L3c6Lz7LeHM+ZW/rWIZB94Tkm5fbYEPW5j0+jt+zf94yBc0MR7PEAjHLqkHxeQIFdZpy +SBRU9Ms7zQVTf/0W8rrmfFE0tUlfcHI45czf8Vkn/E5VfCT1d0SNcCZcvoUq5gk1MLy kUwBfbRNSMP5BXo7Q/tghlRUMUMcD+bIBaG9FUpC/9ri/da0xNkGPsvIuOC3BVz3F2x6 q1qp5K99FSJ4LzDtI4TjYOVGOG/ILT0cGGmJhHuoxEyn5yjsLyYy51Rkaan5duTFh8UL pLOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JsMR4ZGq; 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 bd3si16712495plb.286.2018.12.04.07.35.17; Tue, 04 Dec 2018 07:35:18 -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=JsMR4ZGq; 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 S1726823AbeLDPfR (ORCPT + 15 others); Tue, 4 Dec 2018 10:35:17 -0500 Received: from mail.kernel.org ([198.145.29.99]:39742 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726813AbeLDPfQ (ORCPT ); Tue, 4 Dec 2018 10:35:16 -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 481CA2082B; Tue, 4 Dec 2018 15:35:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543937715; bh=Hkn1cjzkI1ANGZkDNKdZsM21kWfqV4MsegA+Y5dZ57I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JsMR4ZGqIV4KUiNyIdgP7ft9R9qBB1M0EDHeC4elChMlEx8UdcREZHrVDBeT38Noa vMwnQJUgwq/hk+GtNxun93VrCVzsNwrAyWRGOqJ4SMql1/K53/BFTXwpc9OZSWppdo cZTevoZrRBRpxfBffshKaIqhGyIMvGGMT0KItSNo= From: Dinh Nguyen To: stable@vger.kernel.org Cc: dinguyen@kernel.org, gregkh@linuxfoundation.org, sashal@kernel.org, Masahiro Yamada , Philipp Zabel Subject: [PATCHv2 for v4.19-stable 5/6] reset: make device_reset_optional() really optional Date: Tue, 4 Dec 2018 09:34:47 -0600 Message-Id: <20181204153448.6189-6-dinguyen@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181204153448.6189-1-dinguyen@kernel.org> References: <20181204153448.6189-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 Tue Dec 4 15:34:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dinh Nguyen X-Patchwork-Id: 152819 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp8202526ljp; Tue, 4 Dec 2018 07:35:18 -0800 (PST) X-Google-Smtp-Source: AFSGD/UpZI78PkB451DD6UDwf1r+TI27HubhXtieybOI2UxIGhaPCt1NUOd+cW1q2vAd8P7jyDRe X-Received: by 2002:a17:902:7581:: with SMTP id j1mr20609938pll.308.1543937718416; Tue, 04 Dec 2018 07:35:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543937718; cv=none; d=google.com; s=arc-20160816; b=NVdI1/V7McvQglnFsebFiHw0Ym+8yBz80IawNA4q2U33XwcBqY9DVwj4A9h4Yyvkx5 y/7eeGE8GZjxPffrZGy01E2shcuSy9fHGHGKtvx4KXMGEwyfB96cXtZOVEWrBGDPT1Lq pX8JXiw30DR+xGfVSfISDiSdPvnWqPY/DEaIyfUNbFHzhyk9FQI1sYhu5h+gOHoRNTSe xkKwuXweYxZY8x6ql3iLlD3OwvkOOt+jknXzFxGDyLJ2RnxAfTT4V+SCimA0mnTFwKhD swFXWK1A2KVUuCzlwevCGYoMrjl4nkZ00XfM/b3W3ZUjfgFw4hiNnzLgIUKQUbVKGews /2bg== 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=VmFaUUZQ89Ljft8uTI8KHdq+JdGD0QIt0r5xfw516M3IYYnQM54AdVb74vQOACDeqN jWn5OZZ6zVSTgZ554lw8Is3nIsL5S/Fm2dlbD8264xuCZviF+fb41DH1NXTsgqOAsCqs 7o8tUugXGBhkA4MTSzrOniChNXPKBT1mrGkW8DfMnQHyHSxy6qn/Kf0FesshIH3f/Wuj usw2K4rnYprZMi37aw3l8cxhzZg/YKiB2A2Z7205F7ItXNrH6ZOG3y7unf/HBGg6aIhN 12bNt9vSpQqLeyhZQ+RYrRe1ZNfdqDzSEenEiycZNLAD8ZZ4vD48L1llnzNINgWucKoq sv5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VICjfJOa; 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 bd3si16712495plb.286.2018.12.04.07.35.18; Tue, 04 Dec 2018 07:35:18 -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=VICjfJOa; 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 S1726813AbeLDPfR (ORCPT + 15 others); Tue, 4 Dec 2018 10:35:17 -0500 Received: from mail.kernel.org ([198.145.29.99]:39778 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725910AbeLDPfR (ORCPT ); Tue, 4 Dec 2018 10:35:17 -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 1E8FE2081C; Tue, 4 Dec 2018 15:35:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543937716; bh=LxWYhn4Jp3ytIefqdvbxQru4iXG+rCTXjgAQsGFLTsA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VICjfJOaS52opWcuxOBcOILMJsPOH3pPGSmo7UTzIx3uAM5wmdA1hQBwnXlh0O+0c 0SB59lAtvSM7fE9W/GHTl0Dsxf+Dmng5rPCS4Huh68t6S+yK+oOdKMUbewTB+MKKkB N9YUiLsJLI+CY2fVy8/PhksbFwj3Qe7jJ6loQQZY= From: Dinh Nguyen To: stable@vger.kernel.org Cc: dinguyen@kernel.org, gregkh@linuxfoundation.org, sashal@kernel.org, Masahiro Yamada , Philipp Zabel Subject: [PATCHv2 for v4.19-stable 6/6] reset: remove remaining WARN_ON() in Date: Tue, 4 Dec 2018 09:34:48 -0600 Message-Id: <20181204153448.6189-7-dinguyen@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181204153448.6189-1-dinguyen@kernel.org> References: <20181204153448.6189-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); }