Re: [PATCH v4] mmc: dw_mmc: let device core setup the default pin configuration
On Wed, Apr 10, 2013 at 06:56:48AM -0700, Doug Anderson wrote: Thomas, On Wed, Apr 10, 2013 at 5:48 AM, Thomas Abraham thomas.abra...@linaro.org wrote: The call to regulator_enable() is prior to the call to mmc_add_host(). Hence, call to mmc_fre_host is not required in this case. So the above change should be right. Are you sure that mmc_free_host() is the opposite of mmc_add_host() and not mmc_alloc_host()? mmc_free_host() undoes mmc_alloc_host(). mmc_remove_host() undoes mmc_add_host(). alloc add remove free is pretty standard terminology, standard ordering. If add fails, then free is the right thing to call to clean up after the alloc. -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v4] mmc: dw_mmc: let device core setup the default pin configuration
On 10 April 2013 05:00, Doug Anderson diand...@chromium.org wrote: Thomas, On Mon, Apr 8, 2013 at 10:59 PM, Thomas Abraham thomas.abra...@linaro.org wrote: @@ -2002,7 +1994,7 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id) if (ret) { dev_err(host-dev, failed to enable regulator: %d\n, ret); - goto err_setup_bus; + return ret; It seems like you'd need a mmc_free_host(mmc); in this case don't you? AKA: this should be a goto and not a return. Hi Doug, The call to regulator_enable() is prior to the call to mmc_add_host(). Hence, call to mmc_fre_host is not required in this case. So the above change should be right. Thanks, Thomas. -Doug -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v4] mmc: dw_mmc: let device core setup the default pin configuration
Thomas, On Wed, Apr 10, 2013 at 5:48 AM, Thomas Abraham thomas.abra...@linaro.org wrote: The call to regulator_enable() is prior to the call to mmc_add_host(). Hence, call to mmc_fre_host is not required in this case. So the above change should be right. Are you sure that mmc_free_host() is the opposite of mmc_add_host() and not mmc_alloc_host()? I'll double-check myself in a few hours when I'm in front of a computer. -Doug -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v4] mmc: dw_mmc: let device core setup the default pin configuration
Thomas, On Wed, Apr 10, 2013 at 6:56 AM, Doug Anderson diand...@chromium.org wrote: On Wed, Apr 10, 2013 at 5:48 AM, Thomas Abraham thomas.abra...@linaro.org wrote: The call to regulator_enable() is prior to the call to mmc_add_host(). Hence, call to mmc_fre_host is not required in this case. So the above change should be right. Are you sure that mmc_free_host() is the opposite of mmc_add_host() and not mmc_alloc_host()? I'll double-check myself in a few hours when I'm in front of a computer. OK, I double checked and I'm still convinced that the free is needed because we've already called mmc_alloc_host(). Current code always makes sure to free when it returns an error and that seems right to me. -Doug -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH v4] mmc: dw_mmc: let device core setup the default pin configuration
On Wednesday, April 10, 2013, Doug Anderson wrote: Thomas, On Wed, Apr 10, 2013 at 6:56 AM, Doug Anderson diand...@chromium.org wrote: On Wed, Apr 10, 2013 at 5:48 AM, Thomas Abraham thomas.abra...@linaro.org wrote: The call to regulator_enable() is prior to the call to mmc_add_host(). Hence, call to mmc_fre_host is not required in this case. So the above change should be right. Are you sure that mmc_free_host() is the opposite of mmc_add_host() and not mmc_alloc_host()? I'll double-check myself in a few hours when I'm in front of a computer. OK, I double checked and I'm still convinced that the free is needed because we've already called mmc_alloc_host(). Current code always makes sure to free when it returns an error and that seems right to me. mmc_alloc_host corresponds to mmc_free_host. And mmc_add_host matches with mmc_remove_host. Let's focus on mmc_alloc_host. mmc_alloc_host is called prior to regulator_enable. So, if regulator_enable is failed, call of mmc_free_host makes sense. Thanks, Seungwon Jeon -Doug -- To unsubscribe from this list: send the line unsubscribe linux-mmc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v4] mmc: dw_mmc: let device core setup the default pin configuration
Thomas, On Mon, Apr 8, 2013 at 10:59 PM, Thomas Abraham thomas.abra...@linaro.org wrote: @@ -2002,7 +1994,7 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id) if (ret) { dev_err(host-dev, failed to enable regulator: %d\n, ret); - goto err_setup_bus; + return ret; It seems like you'd need a mmc_free_host(mmc); in this case don't you? AKA: this should be a goto and not a return. -Doug -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html