Skip to content

Commit e26557a

Browse files
amboarpavelmachek
authored andcommitted
leds: pca955x: Allow zero LEDs to be specified
It's valid to use the PCA955x devices just for GPIOs and not for LEDs. In this case, as PCA955X_TYPE_GPIO is now equivalent to PCA955X_TYPE_NONE, remove the test for whether we have any child nodes specified in the devicetree. A consequence of this is it's now possible to bind the driver to a PCA955x device when dynamically instantiated through the I2C subsystem's `new_device` interface. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Joel Stanley <joel@jms.id.au> Reviewed-by: Cédric Le Goater <clg@kaod.org> Signed-off-by: Pavel Machek <pavel@ucw.cz>
1 parent ca38625 commit e26557a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/leds/leds-pca955x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ pca955x_get_pdata(struct i2c_client *client, struct pca955x_chipdef *chip)
429429
int count;
430430

431431
count = device_get_child_node_count(&client->dev);
432-
if (!count || count > chip->bits)
432+
if (count > chip->bits)
433433
return ERR_PTR(-ENODEV);
434434

435435
pdata = devm_kzalloc(&client->dev, sizeof(*pdata), GFP_KERNEL);

0 commit comments

Comments
 (0)