From patchwork Fri Jul 8 10:30:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 71668 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp375424qgy; Fri, 8 Jul 2016 03:30:09 -0700 (PDT) X-Received: by 10.98.0.83 with SMTP id 80mr8780527pfa.0.1467973809401; Fri, 08 Jul 2016 03:30:09 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j65si3304665pfb.30.2016.07.08.03.30.09; Fri, 08 Jul 2016 03:30:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=@nifty.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754567AbcGHKaI (ORCPT + 30 others); Fri, 8 Jul 2016 06:30:08 -0400 Received: from conuserg-09.nifty.com ([210.131.2.76]:35335 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754154AbcGHK36 (ORCPT ); Fri, 8 Jul 2016 06:29:58 -0400 Received: from beagle.diag.org (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-09.nifty.com with ESMTP id u68AT3ZR016471; Fri, 8 Jul 2016 19:29:03 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com u68AT3ZR016471 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1467973744; bh=cy0CBTroUDDKjXqn1X64PqKJ+J3rD4qyWk/bKZ29Rno=; h=From:To:Cc:Subject:Date:From; b=EeiDyV+0MTUKn8fQw9gHMrszYHb4mvYh6cOeYxrmJQS78ZHL0gkiwna60qtf7RAIh 8Zo808cjxzizfMCLw5RGxFeFKpmn5DiK9lhL09rKtBBgibwi/dytErq3XjW0HYyFPD bXN47AulAgRb8j6ifx0jNrgJxZV+/z8mNHPkEwfiSnbWSBrV/1Gz8TW7nWYOkXomDE 5EYrgLhqJI83HI7OWoGHkeVfytWeD51HlYizyNMmurJ/nWm7fg8yJJRzhNp+cMp0Lv 5GfytJxM/0Shc8SHPCe40J1VviSPg8oWukhlumNOyUTA+UdeMvUaZeQWwANBB25j4H FkbyvQQSDzOCw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kernel@vger.kernel.org Cc: Hans de Goede , Philipp Zabel , Lee Jones , Masahiro Yamada Subject: [PATCH] reset: add WARN_ON(1) to non-optional reset_control_get variants Date: Fri, 8 Jul 2016 19:30:33 +0900 Message-Id: <1467973833-12466-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The difference between with/without _optional variants is WARN_ON(1) when CONFIG_RESET_CONTROLLER is not defined. Signed-off-by: Masahiro Yamada --- include/linux/reset.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) -- 1.9.1 diff --git a/include/linux/reset.h b/include/linux/reset.h index 45a4abe..cb7db61 100644 --- a/include/linux/reset.h +++ b/include/linux/reset.h @@ -132,6 +132,9 @@ __must_check reset_control_get_exclusive(struct device *dev, const char *id) static inline struct reset_control *reset_control_get_shared( struct device *dev, const char *id) { +#ifndef CONFIG_RESET_CONTROLLER + WARN_ON(1); +#endif return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 1); } @@ -160,6 +163,9 @@ static inline struct reset_control *reset_control_get_optional_shared( static inline struct reset_control *of_reset_control_get_exclusive( struct device_node *node, const char *id) { +#ifndef CONFIG_RESET_CONTROLLER + WARN_ON(1); +#endif return __of_reset_control_get(node, id, 0, 0); } @@ -185,6 +191,9 @@ static inline struct reset_control *of_reset_control_get_exclusive( static inline struct reset_control *of_reset_control_get_shared( struct device_node *node, const char *id) { +#ifndef CONFIG_RESET_CONTROLLER + WARN_ON(1); +#endif return __of_reset_control_get(node, id, 0, 1); } @@ -202,6 +211,9 @@ static inline struct reset_control *of_reset_control_get_shared( static inline struct reset_control *of_reset_control_get_exclusive_by_index( struct device_node *node, int index) { +#ifndef CONFIG_RESET_CONTROLLER + WARN_ON(1); +#endif return __of_reset_control_get(node, NULL, index, 0); } @@ -230,6 +242,9 @@ static inline struct reset_control *of_reset_control_get_exclusive_by_index( static inline struct reset_control *of_reset_control_get_shared_by_index( struct device_node *node, int index) { +#ifndef CONFIG_RESET_CONTROLLER + WARN_ON(1); +#endif return __of_reset_control_get(node, NULL, index, 1); } @@ -267,6 +282,9 @@ __must_check devm_reset_control_get_exclusive(struct device *dev, static inline struct reset_control *devm_reset_control_get_shared( struct device *dev, const char *id) { +#ifndef CONFIG_RESET_CONTROLLER + WARN_ON(1); +#endif return __devm_reset_control_get(dev, id, 0, 1); } @@ -297,6 +315,9 @@ static inline struct reset_control *devm_reset_control_get_optional_shared( static inline struct reset_control * devm_reset_control_get_exclusive_by_index(struct device *dev, int index) { +#ifndef CONFIG_RESET_CONTROLLER + WARN_ON(1); +#endif return __devm_reset_control_get(dev, NULL, index, 0); } @@ -313,6 +334,9 @@ devm_reset_control_get_exclusive_by_index(struct device *dev, int index) static inline struct reset_control * devm_reset_control_get_shared_by_index(struct device *dev, int index) { +#ifndef CONFIG_RESET_CONTROLLER + WARN_ON(1); +#endif return __devm_reset_control_get(dev, NULL, index, 1); }