Re: [PATCH v4 2/4] input: apple_z2: Add a driver for Apple Z2 touchscreens

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

 



On Thu, Jan 16, 2025 at 07:03:13PM +0100, Christophe JAILLET wrote:
> Le 15/01/2025 à 23:46, Sasha Finkelstein via B4 Relay a écrit :
> 
> > +
> > +	/* Wait for device reset to finish */
> > +	usleep_range(5000, 10000);
> > +	error = apple_z2_boot(z2);
> > +	if (error)
> > +		return error;
> > +	return 0;
> 
> Nitpick: These 4 lines could be just:
> 	return apple_z2_boot(z2);

The current form is actually my preference - if a function has multiple
points of failure then do

	error = action(...);
	if (error)
		return error;

everywhere with final "return 0;" at the end. This way it is easier to
rearrange code if needed.

Thanks.

-- 
Dmitry




[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