All of lore.kernel.org
 help / color / mirror / Atom feed
From: Subhash Jadavani <subhashj@codeaurora.org>
To: Michal Potomski <michalx.potomski@intel.com>
Cc: linux-scsi@vger.kernel.org, vinholikatti@gmail.com,
	martin.petersen@oracle.com, jejb@linux.vnet.ibm.com
Subject: Re: [PATCH] scsi: ufs: Clean up some rpm/spm level SysFS nodes upon remove
Date: Thu, 18 May 2017 10:54:11 -0700	[thread overview]
Message-ID: <1489dbd4ee8018edf88cec05998d5137@codeaurora.org> (raw)
In-Reply-To: <1494570987-10128-1-git-send-email-michalx.potomski@intel.com>

On 2017-05-11 23:36, Michal Potomski wrote:
> From: Michał Potomski <michalx.potomski@intel.com>
> 
> When reloading module these two attributes aren't
> cleaned up properly and they persist causing warnings
> when trying to load module again. Additionally they are
> not recreated properly due to that.
> 
> Signed-off-by: Michał Potomski <michalx.potomski@intel.com>
> ---
>  drivers/scsi/ufs/ufshcd.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index abc7e87..ffe8d86 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -7698,6 +7698,12 @@ static inline void
> ufshcd_add_sysfs_nodes(struct ufs_hba *hba)
>  	ufshcd_add_spm_lvl_sysfs_nodes(hba);
>  }
> 
> +static inline void ufshcd_remove_sysfs_nodes(struct ufs_hba *hba)
> +{
> +	device_remove_file(hba->dev, &hba->rpm_lvl_attr);
> +	device_remove_file(hba->dev, &hba->spm_lvl_attr);
> +}
> +
>  /**
>   * ufshcd_shutdown - shutdown routine
>   * @hba: per adapter instance
> @@ -7735,6 +7741,7 @@ int ufshcd_shutdown(struct ufs_hba *hba)
>   */
>  void ufshcd_remove(struct ufs_hba *hba)
>  {
> +	ufshcd_remove_sysfs_nodes(hba);
>  	scsi_remove_host(hba->host);
>  	/* disable interrupts */
>  	ufshcd_disable_intr(hba, hba->intr_mask);


Looks good to me.
Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org>


-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

  reply	other threads:[~2017-05-18 17:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-12  6:36 [PATCH] scsi: ufs: Clean up some rpm/spm level SysFS nodes upon remove Michal Potomski
2017-05-18 17:54 ` Subhash Jadavani [this message]
2017-05-19  1:31 ` Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1489dbd4ee8018edf88cec05998d5137@codeaurora.org \
    --to=subhashj@codeaurora.org \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=michalx.potomski@intel.com \
    --cc=vinholikatti@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.