diff mbox series

[v2,5/8] fpga: region: Rename dev to parent for parent device

Message ID 20210609221135.261837-6-russell.h.weight@intel.com (mailing list archive)
State Superseded
Headers show
Series fpga: Populate dev_release functions | expand

Commit Message

Russ Weight June 9, 2021, 10:11 p.m. UTC
Rename variable "dev" to "parent" in cases where it represents the parent
device.

Signed-off-by: Russ Weight <russell.h.weight@intel.com>
---
v2:
  - This patch contains the renaming of "dev" to "parent" that was previously
    part of the patch: "fpga: region: Use standard dev_release for class driver"
---
 drivers/fpga/fpga-region.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

Comments

Xu Yilun June 10, 2021, 8:07 a.m. UTC | #1
Looks good to me.

Reviewed-by: Xu Yilun <yilun.xu@intel.com>

On Wed, Jun 09, 2021 at 03:11:32PM -0700, Russ Weight wrote:
> Rename variable "dev" to "parent" in cases where it represents the parent
> device.
> 
> Signed-off-by: Russ Weight <russell.h.weight@intel.com>
> ---
> v2:
>   - This patch contains the renaming of "dev" to "parent" that was previously
>     part of the patch: "fpga: region: Use standard dev_release for class driver"
> ---
>  drivers/fpga/fpga-region.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/fpga/fpga-region.c b/drivers/fpga/fpga-region.c
> index c3134b89c3fe..563626d66e56 100644
> --- a/drivers/fpga/fpga-region.c
> +++ b/drivers/fpga/fpga-region.c
> @@ -181,7 +181,7 @@ ATTRIBUTE_GROUPS(fpga_region);
>  
>  /**
>   * fpga_region_create - alloc and init a struct fpga_region
> - * @dev: device parent
> + * @parent: device parent
>   * @mgr: manager that programs this region
>   * @get_bridges: optional function to get bridges to a list
>   *
> @@ -192,7 +192,7 @@ ATTRIBUTE_GROUPS(fpga_region);
>   * Return: struct fpga_region or NULL
>   */
>  struct fpga_region
> -*fpga_region_create(struct device *dev,
> +*fpga_region_create(struct device *parent,
>  		    struct fpga_manager *mgr,
>  		    int (*get_bridges)(struct fpga_region *))
>  {
> @@ -214,8 +214,8 @@ struct fpga_region
>  
>  	device_initialize(&region->dev);
>  	region->dev.class = fpga_region_class;
> -	region->dev.parent = dev;
> -	region->dev.of_node = dev->of_node;
> +	region->dev.parent = parent;
> +	region->dev.of_node = parent->of_node;
>  	region->dev.id = id;
>  
>  	ret = dev_set_name(&region->dev, "region%d", id);
> @@ -268,7 +268,7 @@ static void devm_fpga_region_release(struct device *dev, void *res)
>   * Return: struct fpga_region or NULL
>   */
>  struct fpga_region
> -*devm_fpga_region_create(struct device *dev,
> +*devm_fpga_region_create(struct device *parent,
>  			 struct fpga_manager *mgr,
>  			 int (*get_bridges)(struct fpga_region *))
>  {
> @@ -278,12 +278,12 @@ struct fpga_region
>  	if (!ptr)
>  		return NULL;
>  
> -	region = fpga_region_create(dev, mgr, get_bridges);
> +	region = fpga_region_create(parent, mgr, get_bridges);
>  	if (!region) {
>  		devres_free(ptr);
>  	} else {
>  		*ptr = region;
> -		devres_add(dev, ptr);
> +		devres_add(parent, ptr);
>  	}
>  
>  	return region;
> -- 
> 2.25.1
Xu Yilun June 10, 2021, 8:25 a.m. UTC | #2
Sorry, one more minor comment inline.

On Wed, Jun 09, 2021 at 03:11:32PM -0700, Russ Weight wrote:
> Rename variable "dev" to "parent" in cases where it represents the parent
> device.
> 
> Signed-off-by: Russ Weight <russell.h.weight@intel.com>
> ---
> v2:
>   - This patch contains the renaming of "dev" to "parent" that was previously
>     part of the patch: "fpga: region: Use standard dev_release for class driver"
> ---
>  drivers/fpga/fpga-region.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/fpga/fpga-region.c b/drivers/fpga/fpga-region.c
> index c3134b89c3fe..563626d66e56 100644
> --- a/drivers/fpga/fpga-region.c
> +++ b/drivers/fpga/fpga-region.c
> @@ -181,7 +181,7 @@ ATTRIBUTE_GROUPS(fpga_region);
>  
>  /**
>   * fpga_region_create - alloc and init a struct fpga_region
> - * @dev: device parent
> + * @parent: device parent
>   * @mgr: manager that programs this region
>   * @get_bridges: optional function to get bridges to a list
>   *
> @@ -192,7 +192,7 @@ ATTRIBUTE_GROUPS(fpga_region);
>   * Return: struct fpga_region or NULL
>   */
>  struct fpga_region
> -*fpga_region_create(struct device *dev,
> +*fpga_region_create(struct device *parent,
>  		    struct fpga_manager *mgr,
>  		    int (*get_bridges)(struct fpga_region *))
>  {
> @@ -214,8 +214,8 @@ struct fpga_region
>  
>  	device_initialize(&region->dev);
>  	region->dev.class = fpga_region_class;
> -	region->dev.parent = dev;
> -	region->dev.of_node = dev->of_node;
> +	region->dev.parent = parent;
> +	region->dev.of_node = parent->of_node;
>  	region->dev.id = id;
>  
>  	ret = dev_set_name(&region->dev, "region%d", id);
> @@ -268,7 +268,7 @@ static void devm_fpga_region_release(struct device *dev, void *res)
>   * Return: struct fpga_region or NULL
>   */
>  struct fpga_region
> -*devm_fpga_region_create(struct device *dev,
> +*devm_fpga_region_create(struct device *parent,

You missed the function description doc change in Patch #8

Thanks,
Yilun

>  			 struct fpga_manager *mgr,
>  			 int (*get_bridges)(struct fpga_region *))



>  {
> @@ -278,12 +278,12 @@ struct fpga_region
>  	if (!ptr)
>  		return NULL;
>  
> -	region = fpga_region_create(dev, mgr, get_bridges);
> +	region = fpga_region_create(parent, mgr, get_bridges);
>  	if (!region) {
>  		devres_free(ptr);
>  	} else {
>  		*ptr = region;
> -		devres_add(dev, ptr);
> +		devres_add(parent, ptr);
>  	}
>  
>  	return region;
> -- 
> 2.25.1
Russ Weight June 10, 2021, 6:45 p.m. UTC | #3
On 6/10/21 1:25 AM, Xu Yilun wrote:
> Sorry, one more minor comment inline.
>
> On Wed, Jun 09, 2021 at 03:11:32PM -0700, Russ Weight wrote:
>> Rename variable "dev" to "parent" in cases where it represents the parent
>> device.
>>
>> Signed-off-by: Russ Weight <russell.h.weight@intel.com>
>> ---
>> v2:
>>   - This patch contains the renaming of "dev" to "parent" that was previously
>>     part of the patch: "fpga: region: Use standard dev_release for class driver"
>> ---
>>  drivers/fpga/fpga-region.c | 14 +++++++-------
>>  1 file changed, 7 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/fpga/fpga-region.c b/drivers/fpga/fpga-region.c
>> index c3134b89c3fe..563626d66e56 100644
>> --- a/drivers/fpga/fpga-region.c
>> +++ b/drivers/fpga/fpga-region.c
>> @@ -181,7 +181,7 @@ ATTRIBUTE_GROUPS(fpga_region);
>>  
>>  /**
>>   * fpga_region_create - alloc and init a struct fpga_region
>> - * @dev: device parent
>> + * @parent: device parent
>>   * @mgr: manager that programs this region
>>   * @get_bridges: optional function to get bridges to a list
>>   *
>> @@ -192,7 +192,7 @@ ATTRIBUTE_GROUPS(fpga_region);
>>   * Return: struct fpga_region or NULL
>>   */
>>  struct fpga_region
>> -*fpga_region_create(struct device *dev,
>> +*fpga_region_create(struct device *parent,
>>  		    struct fpga_manager *mgr,
>>  		    int (*get_bridges)(struct fpga_region *))
>>  {
>> @@ -214,8 +214,8 @@ struct fpga_region
>>  
>>  	device_initialize(&region->dev);
>>  	region->dev.class = fpga_region_class;
>> -	region->dev.parent = dev;
>> -	region->dev.of_node = dev->of_node;
>> +	region->dev.parent = parent;
>> +	region->dev.of_node = parent->of_node;
>>  	region->dev.id = id;
>>  
>>  	ret = dev_set_name(&region->dev, "region%d", id);
>> @@ -268,7 +268,7 @@ static void devm_fpga_region_release(struct device *dev, void *res)
>>   * Return: struct fpga_region or NULL
>>   */
>>  struct fpga_region
>> -*devm_fpga_region_create(struct device *dev,
>> +*devm_fpga_region_create(struct device *parent,
> You missed the function description doc change in Patch #8

Thanks for catching that Yilun. I have fixed it for the next patchset.

- Russ
>
> Thanks,
> Yilun
>
>>  			 struct fpga_manager *mgr,
>>  			 int (*get_bridges)(struct fpga_region *))
>
>
>>  {
>> @@ -278,12 +278,12 @@ struct fpga_region
>>  	if (!ptr)
>>  		return NULL;
>>  
>> -	region = fpga_region_create(dev, mgr, get_bridges);
>> +	region = fpga_region_create(parent, mgr, get_bridges);
>>  	if (!region) {
>>  		devres_free(ptr);
>>  	} else {
>>  		*ptr = region;
>> -		devres_add(dev, ptr);
>> +		devres_add(parent, ptr);
>>  	}
>>  
>>  	return region;
>> -- 
>> 2.25.1
diff mbox series

Patch

diff --git a/drivers/fpga/fpga-region.c b/drivers/fpga/fpga-region.c
index c3134b89c3fe..563626d66e56 100644
--- a/drivers/fpga/fpga-region.c
+++ b/drivers/fpga/fpga-region.c
@@ -181,7 +181,7 @@  ATTRIBUTE_GROUPS(fpga_region);
 
 /**
  * fpga_region_create - alloc and init a struct fpga_region
- * @dev: device parent
+ * @parent: device parent
  * @mgr: manager that programs this region
  * @get_bridges: optional function to get bridges to a list
  *
@@ -192,7 +192,7 @@  ATTRIBUTE_GROUPS(fpga_region);
  * Return: struct fpga_region or NULL
  */
 struct fpga_region
-*fpga_region_create(struct device *dev,
+*fpga_region_create(struct device *parent,
 		    struct fpga_manager *mgr,
 		    int (*get_bridges)(struct fpga_region *))
 {
@@ -214,8 +214,8 @@  struct fpga_region
 
 	device_initialize(&region->dev);
 	region->dev.class = fpga_region_class;
-	region->dev.parent = dev;
-	region->dev.of_node = dev->of_node;
+	region->dev.parent = parent;
+	region->dev.of_node = parent->of_node;
 	region->dev.id = id;
 
 	ret = dev_set_name(&region->dev, "region%d", id);
@@ -268,7 +268,7 @@  static void devm_fpga_region_release(struct device *dev, void *res)
  * Return: struct fpga_region or NULL
  */
 struct fpga_region
-*devm_fpga_region_create(struct device *dev,
+*devm_fpga_region_create(struct device *parent,
 			 struct fpga_manager *mgr,
 			 int (*get_bridges)(struct fpga_region *))
 {
@@ -278,12 +278,12 @@  struct fpga_region
 	if (!ptr)
 		return NULL;
 
-	region = fpga_region_create(dev, mgr, get_bridges);
+	region = fpga_region_create(parent, mgr, get_bridges);
 	if (!region) {
 		devres_free(ptr);
 	} else {
 		*ptr = region;
-		devres_add(dev, ptr);
+		devres_add(parent, ptr);
 	}
 
 	return region;