Re: [PATCH 2/4] mfd: Add ROHM BD9571MWV-M MFD PMIC driver

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

 



On 04/24/2017 01:38 PM, Lee Jones wrote:
> On Sun, 16 Apr 2017, Marek Vasut wrote:

[...]

>> +static int bd9571mwv_identify(struct bd9571mwv *bd)
>> +{
>> +	struct device *dev = bd->dev;
>> +	unsigned int value;
>> +	int ret;
>> +
>> +	ret = regmap_read(bd->regmap, BD9571MWV_VENDOR_CODE, &value);
>> +	if (ret) {
>> +		dev_err(dev, "Failed to read vendor code register\n");
> 
> Nit: Don't you care what the return value is?

Not really, but I added the reporting. I wonder whether it shouldn't be
the regmap which reports those kinds of failures, just like ie. when
k*alloc() fails.

>> +		return ret;
>> +	}
>> +
>> +	if (value != BD9571MWV_VENDOR_CODE_VAL) {
>> +		dev_err(dev, "Invalid vendor code ID %02x (expected %02x)\n",
>> +			value, BD9571MWV_VENDOR_CODE_VAL);
>> +		return -EINVAL;
>> +	}
>> +
>> +	ret = regmap_read(bd->regmap, BD9571MWV_PRODUCT_CODE, &value);
>> +	if (ret) {
>> +		dev_err(dev, "Failed to read product code register\n");
> 
> Same.

And fixed globally ...

-- 
Best regards,
Marek Vasut



[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux