Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752936AbbKQInp (ORCPT ); Tue, 17 Nov 2015 03:43:45 -0500 Received: from mout.kundenserver.de ([212.227.126.187]:53579 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752170AbbKQInn (ORCPT ); Tue, 17 Nov 2015 03:43:43 -0500 From: Arnd Bergmann To: Alim Akhtar Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, JBottomley@odin.com, vinholikatti@gmail.com, gautam.vivek@samsung.com, essuuj@gmail.com, devicetree@vger.kernel.org, kishon@ti.com Subject: Re: [PATCH v5 06/11] scsi: ufs: add quirk to enable host controller without hce Date: Tue, 17 Nov 2015 09:43:26 +0100 Message-ID: <3990904.siZhCs2Bgb@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <1447046787-480-7-git-send-email-alim.akhtar@samsung.com> References: <1447046787-480-1-git-send-email-alim.akhtar@samsung.com> <1447046787-480-7-git-send-email-alim.akhtar@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:elBjy8N5N2yCXTWz+bLYNpsMEjkSn9e/s0yEi+fQ6dMMaolH051 BWh9N0QcBwGnq88nSwFXaYbMoeG6Z+I7DzMp4HW8lq6DzdsFDCUhLjG/orU5AGgSJTs8G9U q8laABtaAbmmMsX4RrO3xCKzpJbJ6p96FcV0VP+fQfP7NWGCd1aUwsI9RMyzsbEI3HLwLPZ ZKBjxQo7Yp5YOWojCai+g== X-UI-Out-Filterresults: notjunk:1;V01:K0:CeKjz0iGsRc=:0fI0BHrL732h+9lrEWsw0I Z+Kky5wndbxe0ayQOuW/V2VyBxYd9XRe5KmoOAwz/NxtWjZGBxMugj0WPWi18nQkm93+kQWMX zltSNBbom61L2KwtvcbB/zdCcGnkccKla2C3xDzydXgmVesAONIb5pAE1BP68NFksP34XlxwX UZoEdFNbfiVMtmcsNd6yJaH00UTISxdqFbDwn7IopagHVXSJKDFiDUhj5B0EU1eiazny+xqqP jy8gt7Z+X9zSi7448HBVsvf8QxMFcVQRFkvOQA4YZ5lTRlU9vV4vCivPRdQAVJXbGiGnc9y/E iYk9cD/tXU4+/y5dWYO82xqmxsQe5vbYrYJANQYdob5LmLbqemyW38xLawjsYWF8mC/O+MWxD 5IJp29pOu6WpanH/mquqTnb5+WUiuR4ZPKl2CG0EkfDgMP7yD4RbZHd26b4WA+jS+z/IiAj2g qFm9CgKULvHtScjKFkg89x3GkFY096HOoYc3ZXXedIm7MZCaJl+VuRwsB8QTcbj36OnpSw1oI elqkaj5G32SjbyP8B8f81a+4PqIqxrLOfTTasY/xJAeCug+wGzVntwxl2oZfIhN89RvfYrech HzpAk0usrUmbDxrXfinqufraNgOBZSrJ6mIrd715tdzvk+88kzoYLJVMb8ht+vMbt4oy3pdmS 6H3woS3URZnL/Gm3ve06W1EA7l/K9FRDC1o1iiXyvZN97Sf32AoXJoSJliNedE1EIHTfHh0K3 3IaUuJjzgyMns0zv Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1422 Lines: 36 On Monday 09 November 2015 10:56:22 Alim Akhtar wrote: > +static int ufshcd_hba_enable(struct ufs_hba *hba) > +{ > + int ret; > + > + if (hba->quirks & UFSHCI_QUIRK_BROKEN_HCE) { > + ufshcd_set_link_off(hba); > + ufshcd_vops_hce_enable_notify(hba, PRE_CHANGE); > + > + /* enable UIC related interrupts */ > + ufshcd_enable_intr(hba, UFSHCD_UIC_MASK); > + ret = ufshcd_dme_reset(hba); > + if (!ret) { > + ret = ufshcd_dme_enable(hba); > + if (!ret) > + ufshcd_vops_hce_enable_notify(hba, POST_CHANGE); > + if (ret) > + dev_err(hba->dev, > + "Host controller enable failed with non-hce\n"); > + } > + } else { > + ret = ufshcd_hba_execute_hce(hba); > + } > + > + return ret; quirks are often not the best way to deal with host controller specific differences. How about using a function pointer for ufshcd_hba_enable() that can be one or the oither implementation? Arnd -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/