From: "Marek Behún" <kabel@kernel.org>
To: linux-leds@vger.kernel.org
Cc: "Dan Murphy" <dmurphy@ti.com>, "Pavel Machek" <pavel@ucw.cz>,
"Marek Behún" <kabel@kernel.org>
Subject: [PATCH leds 2/5] leds: turris-omnia: wrap to 80 columns
Date: Fri, 30 Oct 2020 03:39:03 +0100 [thread overview]
Message-ID: <20201030023906.24259-2-kabel@kernel.org> (raw)
In-Reply-To: <20201030023906.24259-1-kabel@kernel.org>
Although checkpatch changed the max-line-length default to 100 columns,
we still prefer 80 columns somewhere.
Signed-off-by: Marek Behún <kabel@kernel.org>
---
drivers/leds/leds-turris-omnia.c | 43 ++++++++++++++++++--------------
1 file changed, 24 insertions(+), 19 deletions(-)
diff --git a/drivers/leds/leds-turris-omnia.c b/drivers/leds/leds-turris-omnia.c
index 80b2d94844f2..096ed7b81957 100644
--- a/drivers/leds/leds-turris-omnia.c
+++ b/drivers/leds/leds-turris-omnia.c
@@ -12,20 +12,20 @@
#include <linux/of.h>
#include "leds.h"
-#define OMNIA_BOARD_LEDS 12
-#define OMNIA_LED_NUM_CHANNELS 3
+#define OMNIA_BOARD_LEDS 12
+#define OMNIA_LED_NUM_CHANNELS 3
-#define CMD_LED_MODE 3
-#define CMD_LED_MODE_LED(l) ((l) & 0x0f)
-#define CMD_LED_MODE_USER 0x10
+#define CMD_LED_MODE 3
+#define CMD_LED_MODE_LED(l) ((l) & 0x0f)
+#define CMD_LED_MODE_USER 0x10
-#define CMD_LED_STATE 4
-#define CMD_LED_STATE_LED(l) ((l) & 0x0f)
-#define CMD_LED_STATE_ON 0x10
+#define CMD_LED_STATE 4
+#define CMD_LED_STATE_LED(l) ((l) & 0x0f)
+#define CMD_LED_STATE_ON 0x10
-#define CMD_LED_COLOR 5
-#define CMD_LED_SET_BRIGHTNESS 7
-#define CMD_LED_GET_BRIGHTNESS 8
+#define CMD_LED_COLOR 5
+#define CMD_LED_SET_BRIGHTNESS 7
+#define CMD_LED_GET_BRIGHTNESS 8
struct omnia_led {
struct led_classdev_mc mc_cdev;
@@ -33,7 +33,7 @@ struct omnia_led {
int reg;
};
-#define to_omnia_led(l) container_of(l, struct omnia_led, mc_cdev)
+#define to_omnia_led(l) container_of(l, struct omnia_led, mc_cdev)
struct omnia_leds {
struct i2c_client *client;
@@ -118,18 +118,21 @@ static int omnia_led_register(struct i2c_client *client, struct omnia_led *led,
CMD_LED_MODE_LED(led->reg) |
CMD_LED_MODE_USER);
if (ret < 0) {
- dev_err(dev, "Cannot set LED %pOF to software mode: %i\n", np, ret);
+ dev_err(dev, "Cannot set LED %pOF to software mode: %i\n", np,
+ ret);
return ret;
}
/* disable the LED */
- ret = i2c_smbus_write_byte_data(client, CMD_LED_STATE, CMD_LED_STATE_LED(led->reg));
+ ret = i2c_smbus_write_byte_data(client, CMD_LED_STATE,
+ CMD_LED_STATE_LED(led->reg));
if (ret < 0) {
dev_err(dev, "Cannot set LED %pOF brightness: %i\n", np, ret);
return ret;
}
- ret = devm_led_classdev_multicolor_register_ext(dev, &led->mc_cdev, &init_data);
+ ret = devm_led_classdev_multicolor_register_ext(dev, &led->mc_cdev,
+ &init_data);
if (ret < 0) {
dev_err(dev, "Cannot register LED %pOF: %i\n", np, ret);
return ret;
@@ -149,7 +152,8 @@ static int omnia_led_register(struct i2c_client *client, struct omnia_led *led,
* file lives in the device directory of the LED controller, not an individual
* LED, so it should not confuse users.
*/
-static ssize_t brightness_show(struct device *dev, struct device_attribute *a, char *buf)
+static ssize_t brightness_show(struct device *dev, struct device_attribute *a,
+ char *buf)
{
struct i2c_client *client = to_i2c_client(dev);
struct omnia_leds *leds = i2c_get_clientdata(client);
@@ -165,8 +169,8 @@ static ssize_t brightness_show(struct device *dev, struct device_attribute *a, c
return sprintf(buf, "%d\n", ret);
}
-static ssize_t brightness_store(struct device *dev, struct device_attribute *a, const char *buf,
- size_t count)
+static ssize_t brightness_store(struct device *dev, struct device_attribute *a,
+ const char *buf, size_t count)
{
struct i2c_client *client = to_i2c_client(dev);
struct omnia_leds *leds = i2c_get_clientdata(client);
@@ -180,7 +184,8 @@ static ssize_t brightness_store(struct device *dev, struct device_attribute *a,
return -EINVAL;
mutex_lock(&leds->lock);
- ret = i2c_smbus_write_byte_data(client, CMD_LED_SET_BRIGHTNESS, (u8) brightness);
+ ret = i2c_smbus_write_byte_data(client, CMD_LED_SET_BRIGHTNESS,
+ (u8)brightness);
mutex_unlock(&leds->lock);
if (ret < 0)
--
2.26.2
next prev parent reply other threads:[~2020-10-30 2:39 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-30 2:39 [PATCH leds 1/5] leds: turris-omnia: use constants instead of macros for color command Marek Behún
2020-10-30 2:39 ` Marek Behún [this message]
2020-10-30 2:39 ` [PATCH leds 3/5] leds: turris-omnia: fix checkpatch warning Marek Behún
2020-10-30 2:39 ` [PATCH leds 4/5] dt-bindings: leds: leds-class-multicolor: use LED_COLOR_ID_RGB for now Marek Behún
2020-10-30 13:08 ` Dan Murphy
2020-10-30 21:46 ` Marek Behún
2020-11-04 21:55 ` Rob Herring
2020-11-04 21:58 ` Dan Murphy
2020-10-30 2:39 ` [PATCH leds 5/5] leds: turris-omnia: check for LED_COLOR_ID_RGB instead LED_COLOR_ID_MULTI Marek Behún
2020-11-25 12:25 ` 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=20201030023906.24259-2-kabel@kernel.org \
--to=kabel@kernel.org \
--cc=dmurphy@ti.com \
--cc=linux-leds@vger.kernel.org \
--cc=pavel@ucw.cz \
/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.