diff mbox series

[v6,2/5] scsi: ufs-qcom: name the dev_ref_clk_ctrl registers

Message ID 20200710072013.177481-3-ebiggers@kernel.org (mailing list archive)
State Accepted
Headers show
Series Inline crypto support on DragonBoard 845c | expand

Commit Message

Eric Biggers July 10, 2020, 7:20 a.m. UTC
From: Eric Biggers <ebiggers@google.com>

In preparation for adding another optional register range to the
ufs-qcom driver, name the existing optional register range
"dev_ref_clk_ctrl_mem".  This allows the driver to refer to the optional
register ranges by name rather than index.

No device-tree files actually have to be updated due to this change,
since none of them actually declares these registers.

Signed-off-by: Eric Biggers <ebiggers@google.com>
---
 drivers/scsi/ufs/ufs-qcom.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Avri Altman July 12, 2020, 8:42 a.m. UTC | #1
> 
> 
> From: Eric Biggers <ebiggers@google.com>
> 
> In preparation for adding another optional register range to the
> ufs-qcom driver, name the existing optional register range
> "dev_ref_clk_ctrl_mem".  This allows the driver to refer to the optional
> register ranges by name rather than index.
> 
> No device-tree files actually have to be updated due to this change,
> since none of them actually declares these registers.
> 
> Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>


> ---
>  drivers/scsi/ufs/ufs-qcom.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c
> index 2e6ddb5cdfc2..bd0b4ed7b37a 100644
> --- a/drivers/scsi/ufs/ufs-qcom.c
> +++ b/drivers/scsi/ufs/ufs-qcom.c
> @@ -1275,7 +1275,8 @@ static int ufs_qcom_init(struct ufs_hba *hba)
>                 host->dev_ref_clk_en_mask = BIT(26);
>         } else {
>                 /* "dev_ref_clk_ctrl_mem" is optional resource */
> -               res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> +               res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
> +                                                  "dev_ref_clk_ctrl_mem");
>                 if (res) {
>                         host->dev_ref_clk_ctrl_mmio =
>                                         devm_ioremap_resource(dev, res);
> --
> 2.27.0
Bjorn Andersson July 22, 2020, 5:07 a.m. UTC | #2
On Fri 10 Jul 00:20 PDT 2020, Eric Biggers wrote:

> From: Eric Biggers <ebiggers@google.com>
> 
> In preparation for adding another optional register range to the
> ufs-qcom driver, name the existing optional register range
> "dev_ref_clk_ctrl_mem".  This allows the driver to refer to the optional
> register ranges by name rather than index.
> 
> No device-tree files actually have to be updated due to this change,
> since none of them actually declares these registers.
> 

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

> Signed-off-by: Eric Biggers <ebiggers@google.com>
> ---
>  drivers/scsi/ufs/ufs-qcom.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c
> index 2e6ddb5cdfc2..bd0b4ed7b37a 100644
> --- a/drivers/scsi/ufs/ufs-qcom.c
> +++ b/drivers/scsi/ufs/ufs-qcom.c
> @@ -1275,7 +1275,8 @@ static int ufs_qcom_init(struct ufs_hba *hba)
>  		host->dev_ref_clk_en_mask = BIT(26);
>  	} else {
>  		/* "dev_ref_clk_ctrl_mem" is optional resource */
> -		res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> +		res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
> +						   "dev_ref_clk_ctrl_mem");
>  		if (res) {
>  			host->dev_ref_clk_ctrl_mmio =
>  					devm_ioremap_resource(dev, res);
> -- 
> 2.27.0
>
diff mbox series

Patch

diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c
index 2e6ddb5cdfc2..bd0b4ed7b37a 100644
--- a/drivers/scsi/ufs/ufs-qcom.c
+++ b/drivers/scsi/ufs/ufs-qcom.c
@@ -1275,7 +1275,8 @@  static int ufs_qcom_init(struct ufs_hba *hba)
 		host->dev_ref_clk_en_mask = BIT(26);
 	} else {
 		/* "dev_ref_clk_ctrl_mem" is optional resource */
-		res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
+		res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
+						   "dev_ref_clk_ctrl_mem");
 		if (res) {
 			host->dev_ref_clk_ctrl_mmio =
 					devm_ioremap_resource(dev, res);