Thread (39 messages) 39 messages, 7 authors, 2025-03-18

Re: [PATCH v4 07/10] gpio: max7360: Add MAX7360 gpio support

From: Andy Shevchenko <hidden>
Date: 2025-02-14 16:18:34
Also in: linux-devicetree, linux-gpio, linux-pwm, lkml

On Fri, Feb 14, 2025 at 05:59:40PM +0200, Andy Shevchenko wrote:
On Fri, Feb 14, 2025 at 12:49:57PM +0100, Mathieu Dubois-Briand wrote:
...
quoted
+		ret = device_property_read_u32(dev, "maxim,constant-current-disable", &outconf);
+		if (ret && (ret != -EINVAL))
+			return dev_err_probe(dev, -ENODEV,
Why shadowing the real error code?
quoted
+					     "Failed to read maxim,constant-current-disable OF property\n");
It may be not only OF :-)
Btw, can you compare this approach and the below in terms of bloat-o-meter
against the object file size?

	// can be done without this as well, just the same string as a parameter
	const char *propname;

	propname = "maxim,constant-current-disable";
	ret = device_property_read_u32(dev, propname, &outconf);
	if (ret && (ret != -EINVAL))
		return dev_err_probe(dev, ret, "Failed to read %s device property\n", propname);

While the above is strong hint to the compiler, the below should give similar
result but by the duplicates elimination:

	ret = device_property_read_u32(dev, "maxim,constant-current-disable", &outconf);
	if (ret && (ret != -EINVAL))
		return dev_err_probe(dev, ret, "Failed to read %s device property\n",
				     "maxim,constant-current-disable");

-- 
With Best Regards,
Andy Shevchenko

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help