soc: qcom: llcc: Name regmaps to avoid collisions
Subsystems (2)
PATCH 1/1 soc: qcom: llcc: Name regmaps to avoid collisions
We'll end up with debugfs collisions if we don't give names to the regmaps created inside this driver. Copy the template config over into this function and give the regmap the same name as the resource name.
--- drivers/soc/qcom/llcc-slice.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/soc/qcom/llcc-slice.c +7 -7
@@ -48,13 +48,6 @@static struct llcc_drv_data *drv_data = (void *) -EPROBE_DEFER ; -static const struct regmap_config llcc_regmap_config = { - .reg_bits =32 , - .reg_stride =4 , - .val_bits =32 , - .fast_io = true, -}; -/** * llcc_slice_getd - get llcc slice descriptor * @uid: usecase_id for the client
@@ -314,6 +307,12 @@ static struct regmap *qcom_llcc_init_mmio(struct platform_device *pdev, {struct resource *res;void __iomem *base; +static struct regmap_config llcc_regmap_config = { + .reg_bits =32 , + .reg_stride =4 , + .val_bits =32 , + .fast_io = true, + }; res =platform_get_resource_byname (pdev,IORESOURCE_MEM , name);if (!res)
@@ -323,6 +322,7 @@ static struct regmap *qcom_llcc_init_mmio(struct platform_device *pdev,if (IS_ERR (base))return ERR_CAST (base); + llcc_regmap_config.name = name;return devm_regmap_init_mmio (&pdev->dev, base, &llcc_regmap_config); }
Signature · 1 line
Sent by a computer through tubes
Quoted 32 lines · Stephen Boyd
We'll end up with debugfs collisions if we don't give names to the regmaps created inside this driver. Copy the template config over into this function and give the regmap the same name as the resource name.
Fixes 7f9c136216c7 ("soc: qcom: Add broadcast base for Last Level Cache Controller (LLCC)")Cc Venkata Narendra Kumar Gutta <[email protected]>Cc Evan Green <[email protected]>Signed-off-by Stephen Boyd <[email protected]>--- drivers/soc/qcom/llcc-slice.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)drivers/soc/qcom/llcc-slice.c +0
-7@@ -48,13 +48,6 @@static struct llcc_drv_data *drv_data = (void *) -EPROBE_DEFER ; -static const struct regmap_config llcc_regmap_config = { - .reg_bits =32 , - .reg_stride =4 , - .val_bits =32 , - .fast_io = true, -}; -/** * llcc_slice_getd - get llcc slice descriptor * @uid: usecase_id for the client
drivers/soc/qcom/llcc-slice.c static struct regmap *qcom_llcc_init_mmio(struct platform_device *pdev, · line 315
Quoted 9 lines
drivers/soc/qcom/llcc-slice.c +6
-0@@ -314,6 +307,12 @@ static struct regmap *qcom_llcc_init_mmio(struct platform_device *pdev, {struct resource *res;void __iomem *base; +static struct regmap_config llcc_regmap_config = { + .reg_bits =32 , + .reg_stride =4 , + .val_bits =32 , + .fast_io = true, + };
Why did you move this to be a static local? I think it works, but it makes it look like this is a local variable that's possibly used out of scope. Maybe leave it as a global?
Quoting Evan Green (2019-10-07 14:20:47)
Quoted 38 lines · Stephen Boyd
Quoted 37 lines
We'll end up with debugfs collisions if we don't give names to the regmaps created inside this driver. Copy the template config over into this function and give the regmap the same name as the resource name.
Fixes 7f9c136216c7 ("soc: qcom: Add broadcast base for Last Level Cache Controller (LLCC)")Cc Venkata Narendra Kumar Gutta <[email protected]>Cc Evan Green <[email protected]>Signed-off-by Stephen Boyd <[email protected]>--- drivers/soc/qcom/llcc-slice.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)drivers/soc/qcom/llcc-slice.c +2
-7@@ -48,13 +48,6 @@static struct llcc_drv_data *drv_data = (void *) -EPROBE_DEFER ; -static const struct regmap_config llcc_regmap_config = { - .reg_bits =32 , - .reg_stride =4 , - .val_bits =32 , - .fast_io = true, -}; -/** * llcc_slice_getd - get llcc slice descriptor * @uid: usecase_id for the client @@ -314,6 +307,12 @@ static struct regmap *qcom_llcc_init_mmio(struct platform_device *pdev, {struct resource *res;void __iomem *base; +static struct regmap_config llcc_regmap_config = { + .reg_bits =32 ,
Quoted 8 lines
drivers/soc/qcom/llcc-slice.c static struct regmap *qcom_llcc_init_mmio(struct platform_device *pdev, · line 315
Quoted 4 lines
drivers/soc/qcom/llcc-slice.c +4
-0+ .reg_stride = 4, + .val_bits = 32, + .fast_io = true, + };Why did you move this to be a static local? I think it works, but it makes it look like this is a local variable that's possibly used out of scope. Maybe leave it as a global?
And have a followup patch to move it to a static local? Sounds ok to me if you prefer.