Re: [PATCH v4 2/2] gpio: ds4520: Add ADI DS4520 GPIO Expander Support

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

 



On 27/07/2023 11:03, Krzysztof Kozlowski wrote:
> On 27/07/2023 10:52, Okan Sahin wrote:
>> The DS4520 is a 9-bit nonvolatile (NV) I/O expander.
>> It offers users a digitally programmable alternative
>> to hardware jumpers and mechanical switches that are
>> being used to control digital logic node.
>>
>> Signed-off-by: Okan Sahin <okan.sahin@xxxxxxxxxx>
> 
> ...
> 
>> +static int ds4520_gpio_probe(struct i2c_client *client)
>> +{
>> +	struct gpio_regmap_config config = { };
>> +	struct device *dev = &client->dev;
>> +	struct regmap *regmap;
>> +	u32 ngpio;
>> +	u32 base;
>> +	int ret;
>> +
>> +	ret = device_property_read_u32(dev, "reg", &base);
>> +	if (ret) {
>> +		dev_err_probe(dev, ret,
>> +			  "Missing 'reg' property.\n");
>> +		return -EINVAL;
> 
> Nope.
> 
>> +	}
>> +
>> +	ret = device_property_read_u32(dev, "ngpios", &ngpio);
>> +	if (ret) {
>> +		dev_err_probe(dev, ret,
>> +			  "Missing 'ngpios' property.\n");
>> +		return -EINVAL;
> 
> Nope.
> 
>> +	}
>> +
>> +	regmap = devm_regmap_init_i2c(client, &ds4520_regmap_config);
>> +	if (IS_ERR(regmap)) {
>> +		ret = PTR_ERR(regmap);
>> +		dev_err_probe(dev, ret,
>> +			      "Failed to allocate register map\n");
>> +		return ret;
> 
> That's not correct syntax. What did you receive in previous
> comments/feedback?

Hm, I might be mixing patches, so maybe you never received feedback on
this. Anyway, all these three lines must be one line:

return dev_err_probe()

Previous places should be fixed similar way.

Best regards,
Krzysztof




[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