From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754219AbaHFVAE (ORCPT ); Wed, 6 Aug 2014 17:00:04 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:58194 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753826AbaHFVAB (ORCPT ); Wed, 6 Aug 2014 17:00:01 -0400 From: Arnd Bergmann To: Peter Griffin Subject: Re: [PATCH v3 1/6] usb: host: usb-st-common: Add common code required by ohci-st and ehci-st Date: Wed, 6 Aug 2014 22:59:10 +0200 User-Agent: KMail/1.12.2 (Linux/3.8.0-35-generic; KDE/4.3.2; x86_64; ; ) Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, stern@rowland.harvard.edu, srinivas.kandagatla@gmail.com, maxime.coquelin@st.com, patrice.chotard@st.com, lee.jones@linaro.org, devicetree@vger.kernel.org, linux-usb@vger.kernel.org References: <1407344589-24863-1-git-send-email-peter.griffin@linaro.org> <1407344589-24863-2-git-send-email-peter.griffin@linaro.org> In-Reply-To: <1407344589-24863-2-git-send-email-peter.griffin@linaro.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201408062259.10697.arnd@arndb.de> X-Provags-ID: V02:K0:T8JXJbmfnnOqGVSnTlH3KI/DZO4uKKWtsgAf5SD8Ns2 EScogEx4Axs3r3F5o9r7BIFJVp3yvsY+HcmWMw2t8Q+VY6aPW3 KQxjvUrVXJVMmVxB46cWUhUjiocKvWXpy6mcU2LWKTQqgUIkpP nfkYv4PMAqWIKsDdtHBAo/pWAnVAAoWbGFc2XyOtt6FU2fgwtJ 6k8iB/tSnfmiZwpPLj0s67WmviIoQ4DfgtbQvmxfCqXHhCVz/g Ihn1/fH1ZdZ5nkxcdg2Ma6MK20LeyyScQCBGOpmCy5/33arDCX 9TP8jvUeA8fGwM3zpo0Vy+GEZe8zcCk7t/alhTGfddPlBq6UFA 02aizzzEAfrWTE45N7dlHfcibMvH7wBqZaKu8CyZG X-UI-Out-Filterresults: notjunk:1; Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday 06 August 2014, Peter Griffin wrote: > +int st_usb_platform_power_on(struct st_platform_priv *priv) > +{ > + int clk, ret; > + > + if (priv->pwr) { > + ret = reset_control_deassert(priv->pwr); > + if (ret) > + return ret; > + } > + > + if (priv->rst) { > + ret = > (priv->rst); > + if (ret) > + goto err_assert_power; > + } I wouldn't make these optional, just call the functions unconditionally and fail the probe function if they are not available. I'm not sure if it's worth keeping these functions in a common file. You are adding complexity this way and I don't think you are even saving a significant number of code lines compared to just having two copies of them. > +EXPORT_SYMBOL(st_usb_platform_power_on); If you want to keep them, it would be best to make Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [PATCH v3 1/6] usb: host: usb-st-common: Add common code required by ohci-st and ehci-st Date: Wed, 6 Aug 2014 22:59:10 +0200 Message-ID: <201408062259.10697.arnd@arndb.de> References: <1407344589-24863-1-git-send-email-peter.griffin@linaro.org> <1407344589-24863-2-git-send-email-peter.griffin@linaro.org> Mime-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1407344589-24863-2-git-send-email-peter.griffin-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Peter Griffin Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org, stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org, srinivas.kandagatla-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, maxime.coquelin-qxv4g6HH51o@public.gmane.org, patrice.chotard-qxv4g6HH51o@public.gmane.org, lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: devicetree@vger.kernel.org On Wednesday 06 August 2014, Peter Griffin wrote: > +int st_usb_platform_power_on(struct st_platform_priv *priv) > +{ > + int clk, ret; > + > + if (priv->pwr) { > + ret = reset_control_deassert(priv->pwr); > + if (ret) > + return ret; > + } > + > + if (priv->rst) { > + ret = > (priv->rst); > + if (ret) > + goto err_assert_power; > + } I wouldn't make these optional, just call the functions unconditionally and fail the probe function if they are not available. I'm not sure if it's worth keeping these functions in a common file. You are adding complexity this way and I don't think you are even saving a significant number of code lines compared to just having two copies of them. > +EXPORT_SYMBOL(st_usb_platform_power_on); If you want to keep them, it would be best to make Arnd -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 From: arnd@arndb.de (Arnd Bergmann) Date: Wed, 6 Aug 2014 22:59:10 +0200 Subject: [PATCH v3 1/6] usb: host: usb-st-common: Add common code required by ohci-st and ehci-st In-Reply-To: <1407344589-24863-2-git-send-email-peter.griffin@linaro.org> References: <1407344589-24863-1-git-send-email-peter.griffin@linaro.org> <1407344589-24863-2-git-send-email-peter.griffin@linaro.org> Message-ID: <201408062259.10697.arnd@arndb.de> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Wednesday 06 August 2014, Peter Griffin wrote: > +int st_usb_platform_power_on(struct st_platform_priv *priv) > +{ > + int clk, ret; > + > + if (priv->pwr) { > + ret = reset_control_deassert(priv->pwr); > + if (ret) > + return ret; > + } > + > + if (priv->rst) { > + ret = > (priv->rst); > + if (ret) > + goto err_assert_power; > + } I wouldn't make these optional, just call the functions unconditionally and fail the probe function if they are not available. I'm not sure if it's worth keeping these functions in a common file. You are adding complexity this way and I don't think you are even saving a significant number of code lines compared to just having two copies of them. > +EXPORT_SYMBOL(st_usb_platform_power_on); If you want to keep them, it would be best to make Arnd