lkml.org 
[lkml]   [2013]   [Jun]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 2/4] MFD: Palmas: Add SMPS10_BOOST feature
On 06/18/2013 04:03 AM, J Keerthy wrote:
> The SMPS10 regulator is not presesnt in all the variants
> of the PALMAS PMIC family. Hence adding a feature to distingush
> between them.

> diff --git a/drivers/mfd/palmas.c b/drivers/mfd/palmas.c

> + match = of_match_device(of_match_ptr(of_palmas_match_tbl), &i2c->dev);
> +
> + if (match) {
> + features = (unsigned int *)match->data;
> + palmas->features = *features;
> + } else {
> + return -ENODATA;
> + }


I think it's more common to do the error-checking first. That way, the
success-case code doesn't need an indent:

match = of_match...(...);
if (!match)
return -ENODATA;

features = ...;
palmas->features = *features;



\
 
 \ /
  Last update: 2013-06-18 18:41    [W:0.051 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site