Re: [PATCH v2 6/6] of: Refactor node and property manipulation function locking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Aug 04, 2023 at 04:41:56PM -0600, Rob Herring wrote:
> All callers of __of_{add,remove,update}_property() and
> __of_{attach,detach}_node() wrap the call with the devtree_lock
> spinlock. Let's move the spinlock into the functions. This allows moving
> the sysfs update functions into those functions as well.

...

>  	for (next = &np->properties; *next; next = &(*next)->next) {
>  		if (*next == prop)
>  			break;
>  	}
> -	if (*next == NULL)
> -		return -ENODEV;
> -
> +	if (*next == NULL) {
> +		rc = -ENODEV;
> +		goto out_unlock;
> +	}
>  	/* found the node */
>  	*next = prop->next;
>  	prop->next = np->deadprops;

But this also looks like a dup for deadprop, maybe something like

static int __of_remove_property_dead_or_alive() // pun intended.

?

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux