All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Eddie James <eajames@linux.ibm.com>
Cc: linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org, robh+dt@kernel.org
Subject: Re: [PATCH v2 6/7] leds: pca955x: Let the core process the fwnode
Date: Fri, 20 Aug 2021 11:02:43 +0200	[thread overview]
Message-ID: <20210820090243.GD22757@amd> (raw)
In-Reply-To: <20210716220331.49303-7-eajames@linux.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 987 bytes --]

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 #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

  reply	other threads:[~2021-08-20  9:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-16 22:03 [PATCH v2 0/7] leds: Support retaining state for the PCA955x Eddie James
2021-07-16 22:03 ` [PATCH v2 1/7] dt-bindings: leds: Add retain-state-shutdown boolean Eddie James
2021-07-16 22:03 ` [PATCH v2 2/7] leds: leds-core: Implement the retain-state-shutdown property Eddie James
2021-07-16 22:03 ` [PATCH v2 3/7] leds: pca955x: Clean up code formatting Eddie James
2021-07-16 22:03 ` [PATCH v2 4/7] leds: pca955x: Add brightness_get function Eddie James
2021-07-16 22:03 ` [PATCH v2 5/7] leds: pca955x: Implement the default-state property Eddie James
2021-07-16 22:03 ` [PATCH v2 6/7] leds: pca955x: Let the core process the fwnode Eddie James
2021-08-20  9:02   ` Pavel Machek [this message]
2021-07-16 22:03 ` [PATCH v2 7/7] leds: pca955x: Switch to i2c probe_new Eddie James
2021-08-20  9:00 ` [PATCH v2 0/7] leds: Support retaining state for the PCA955x Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210820090243.GD22757@amd \
    --to=pavel@ucw.cz \
    --cc=devicetree@vger.kernel.org \
    --cc=eajames@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.