media: mc: delete redundant code in __media_device_unregister_entity

Message ID 20220324102752.47077-1-hbh25y@gmail.com (mailing list archive)
State Accepted
Headers
Series media: mc: delete redundant code in __media_device_unregister_entity |

Commit Message

Hangyu Hua March 24, 2022, 10:27 a.m. UTC
  media_gobj_destroy has already set graph_obj.mdev to NULL. There is no need to
set it again.

Signed-off-by: Hangyu Hua <hbh25y@gmail.com>
---
 drivers/media/mc/mc-device.c | 1 -
 1 file changed, 1 deletion(-)
  

Comments

Laurent Pinchart March 24, 2022, 1:47 p.m. UTC | #1
Hi Hangyu,

Thank you for the patch.

On Thu, Mar 24, 2022 at 06:27:52PM +0800, Hangyu Hua wrote:
> media_gobj_destroy has already set graph_obj.mdev to NULL. There is no need to
> set it again.
> 
> Signed-off-by: Hangyu Hua <hbh25y@gmail.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/media/mc/mc-device.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/media/mc/mc-device.c b/drivers/media/mc/mc-device.c
> index cf5e459b1d96..7727c619043e 100644
> --- a/drivers/media/mc/mc-device.c
> +++ b/drivers/media/mc/mc-device.c
> @@ -605,7 +605,6 @@ static void __media_device_unregister_entity(struct media_entity *entity)
>  
>  	/* invoke entity_notify callbacks to handle entity removal?? */
>  
> -	entity->graph_obj.mdev = NULL;
>  }
>  
>  /**
  
Sakari Ailus March 30, 2022, 11:05 a.m. UTC | #2
On Thu, Mar 24, 2022 at 03:47:10PM +0200, Laurent Pinchart wrote:
> Hi Hangyu,
> 
> Thank you for the patch.
> 
> On Thu, Mar 24, 2022 at 06:27:52PM +0800, Hangyu Hua wrote:
> > media_gobj_destroy has already set graph_obj.mdev to NULL. There is no need to
> > set it again.
> > 
> > Signed-off-by: Hangyu Hua <hbh25y@gmail.com>
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> > ---
> >  drivers/media/mc/mc-device.c | 1 -
> >  1 file changed, 1 deletion(-)
> > 
> > diff --git a/drivers/media/mc/mc-device.c b/drivers/media/mc/mc-device.c
> > index cf5e459b1d96..7727c619043e 100644
> > --- a/drivers/media/mc/mc-device.c
> > +++ b/drivers/media/mc/mc-device.c
> > @@ -605,7 +605,6 @@ static void __media_device_unregister_entity(struct media_entity *entity)
> >  
> >  	/* invoke entity_notify callbacks to handle entity removal?? */
> >  
> > -	entity->graph_obj.mdev = NULL;

Removed the extra newline above, too. Applied.

Please run scripts/checkpatch.pl on the patches, too.

> >  }
> >  
> >  /**
> 
> -- 
> Regards,
> 
> Laurent Pinchart
  
Hangyu Hua March 31, 2022, 1:52 a.m. UTC | #3
On 2022/3/30 19:05, Sakari Ailus wrote:
> On Thu, Mar 24, 2022 at 03:47:10PM +0200, Laurent Pinchart wrote:
>> Hi Hangyu,
>>
>> Thank you for the patch.
>>
>> On Thu, Mar 24, 2022 at 06:27:52PM +0800, Hangyu Hua wrote:
>>> media_gobj_destroy has already set graph_obj.mdev to NULL. There is no need to
>>> set it again.
>>>
>>> Signed-off-by: Hangyu Hua <hbh25y@gmail.com>
>>
>> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>>
>>> ---
>>>   drivers/media/mc/mc-device.c | 1 -
>>>   1 file changed, 1 deletion(-)
>>>
>>> diff --git a/drivers/media/mc/mc-device.c b/drivers/media/mc/mc-device.c
>>> index cf5e459b1d96..7727c619043e 100644
>>> --- a/drivers/media/mc/mc-device.c
>>> +++ b/drivers/media/mc/mc-device.c
>>> @@ -605,7 +605,6 @@ static void __media_device_unregister_entity(struct media_entity *entity)
>>>   
>>>   	/* invoke entity_notify callbacks to handle entity removal?? */
>>>   
>>> -	entity->graph_obj.mdev = NULL;
> 
> Removed the extra newline above, too. Applied.
> 
> Please run scripts/checkpatch.pl on the patches, too.

Thanks. I will make a v2 with this change.
> 
>>>   }
>>>   
>>>   /**
>>
>> -- 
>> Regards,
>>
>> Laurent Pinchart
>
  

Patch

diff --git a/drivers/media/mc/mc-device.c b/drivers/media/mc/mc-device.c
index cf5e459b1d96..7727c619043e 100644
--- a/drivers/media/mc/mc-device.c
+++ b/drivers/media/mc/mc-device.c
@@ -605,7 +605,6 @@  static void __media_device_unregister_entity(struct media_entity *entity)
 
 	/* invoke entity_notify callbacks to handle entity removal?? */
 
-	entity->graph_obj.mdev = NULL;
 }
 
 /**