Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932293AbbBLNxt (ORCPT ); Thu, 12 Feb 2015 08:53:49 -0500 Received: from mail-la0-f47.google.com ([209.85.215.47]:37848 "EHLO mail-la0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755701AbbBLNxq (ORCPT ); Thu, 12 Feb 2015 08:53:46 -0500 MIME-Version: 1.0 In-Reply-To: <1423576735-26267-3-git-send-email-gbroner@codeaurora.org> References: <1423576735-26267-1-git-send-email-gbroner@codeaurora.org> <1423576735-26267-3-git-send-email-gbroner@codeaurora.org> Date: Thu, 12 Feb 2015 22:53:44 +0900 Message-ID: Subject: Re: [PATCH v2 2/4] scsi: ufs: add debugfs for ufs From: Akinobu Mita To: Gilad Broner Cc: Jej B , LKML , "linux-scsi@vger.kernel.org" , linux-arm-msm@vger.kernel.org, Santosh Y , linux-scsi-owner@vger.kernel.org, Subhash Jadavani , Yaniv Gardi , Dolev Raviv , Lee Susman , Raviv Shvili , Vinayak Holikatti , "James E.J. Bottomley" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1376 Lines: 45 2015-02-10 22:58 GMT+09:00 Gilad Broner : > @@ -5760,6 +5963,8 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq) > > async_schedule(ufshcd_async_scan, hba); > > + UFSDBG_ADD_DEBUGFS(hba); > + > return 0; > > out_remove_scsi_host: > @@ -5769,6 +5974,7 @@ exit_gating: > out_disable: > hba->is_irq_enabled = false; > scsi_host_put(host); > + UFSDBG_REMOVE_DEBUGFS(hba); > ufshcd_hba_exit(hba); > out_error: > return err; UFSDBG_REMOVE_DEBUGFS() is not called in the driver unloading path. So ufs debugfs directory is not removed when unloading driver. It should be called in ufshcd_remove(). BTW, do we really need UFSDBG_ADD_DEBUGFS() and UFSDBG_REMOVE_DEBUGFS() macros? We can use static inline functions in ufs-debugfs.h when !CONFIG_DEBUG_FS. #ifdef CONFIG_DEBUG_FS void ufsdbg_add_debugfs(struct ufs_hba *hba); void ufsdbg_remove_debugfs(struct ufs_hba *hba); #else static inline void ufsdbg_add_debugfs(struct ufs_hba *hba) { } static inline void ufsdbg_remove_debugfs(struct ufs_hba *hba) { } #endif -- 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/