Re: [PATCH v2 6/7] leds: pca955x: Let the core process the fwnode

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

 



Hi!

> -			err = devm_led_classdev_register(&client->dev, led);
> +			init_data.fwnode = pdata->leds[i].fwnode;
> +
> +			if (is_of_node(init_data.fwnode)) {
> +				if (to_of_node(init_data.fwnode)->name[0] ==
> +				    '\0')
> +					set_default_label = true;
> +				else
> +					set_default_label = false;
> +			} else {
> +				set_default_label = true;
> +			}

I'd write it as

		set_default_label = true;
		if (... && ...)
			set_default_label = false;

> +			if (set_default_label) {
> +				snprintf(default_label, sizeof(default_label),
> +					 "%d", i);
> +				init_data.default_label = default_label;
> +			} else {
> +				init_data.default_label = NULL;
> +			}

		init_data.default_label = NULL;
		if (...) {
		      set_default_label) {
> +				snprintf(default_label, sizeof(default_label),
> +					 "%d", i);
> +				init_data.default_label = default_label;
		}


Thank you,
							Pavel
-- 
http://www.livejournal.com/~pavelmachek

Attachment: signature.asc
Description: Digital signature


[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