Skip to content

Commit 513246a

Browse files
author
Bartosz Golaszewski
committed
gpio: sysfs: drop tabs from local variable declarations
Older code has an annoying habit of putting tabs between the type and the name of the variable. This doesn't really add to readability and newer code doesn't do it so make the entire file consistent. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
1 parent 0338f6a commit 513246a

1 file changed

Lines changed: 32 additions & 33 deletions

File tree

drivers/gpio/gpiolib-sysfs.c

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,10 @@ static irqreturn_t gpio_sysfs_irq(int irq, void *priv)
165165
/* Caller holds gpiod-data mutex. */
166166
static int gpio_sysfs_request_irq(struct device *dev, unsigned char flags)
167167
{
168-
struct gpiod_data *data = dev_get_drvdata(dev);
169-
struct gpio_desc *desc = data->desc;
170-
unsigned long irq_flags;
171-
int ret;
168+
struct gpiod_data *data = dev_get_drvdata(dev);
169+
struct gpio_desc *desc = data->desc;
170+
unsigned long irq_flags;
171+
int ret;
172172

173173
data->irq = gpiod_to_irq(desc);
174174
if (data->irq < 0)
@@ -259,7 +259,7 @@ static ssize_t edge_store(struct device *dev,
259259
struct device_attribute *attr, const char *buf, size_t size)
260260
{
261261
struct gpiod_data *data = dev_get_drvdata(dev);
262-
ssize_t status = size;
262+
ssize_t status = size;
263263
int flags;
264264

265265
flags = sysfs_match_string(trigger_names, buf);
@@ -292,10 +292,11 @@ static DEVICE_ATTR_RW(edge);
292292
/* Caller holds gpiod-data mutex. */
293293
static int gpio_sysfs_set_active_low(struct device *dev, int value)
294294
{
295-
struct gpiod_data *data = dev_get_drvdata(dev);
296-
struct gpio_desc *desc = data->desc;
297-
int status = 0;
298-
unsigned int flags = data->irq_flags;
295+
struct gpiod_data *data = dev_get_drvdata(dev);
296+
unsigned int flags = data->irq_flags;
297+
struct gpio_desc *desc = data->desc;
298+
int status = 0;
299+
299300

300301
if (!!test_bit(FLAG_ACTIVE_LOW, &desc->flags) == !!value)
301302
return 0;
@@ -331,9 +332,9 @@ static ssize_t active_low_show(struct device *dev,
331332
static ssize_t active_low_store(struct device *dev,
332333
struct device_attribute *attr, const char *buf, size_t size)
333334
{
334-
struct gpiod_data *data = dev_get_drvdata(dev);
335-
ssize_t status;
336-
long value;
335+
struct gpiod_data *data = dev_get_drvdata(dev);
336+
ssize_t status;
337+
long value;
337338

338339
status = kstrtol(buf, 0, &value);
339340
if (status)
@@ -399,7 +400,7 @@ static const struct attribute_group *gpio_groups[] = {
399400
static ssize_t base_show(struct device *dev,
400401
struct device_attribute *attr, char *buf)
401402
{
402-
const struct gpio_chip *chip = dev_get_drvdata(dev);
403+
const struct gpio_chip *chip = dev_get_drvdata(dev);
403404

404405
return sysfs_emit(buf, "%d\n", chip->base);
405406
}
@@ -408,7 +409,7 @@ static DEVICE_ATTR_RO(base);
408409
static ssize_t label_show(struct device *dev,
409410
struct device_attribute *attr, char *buf)
410411
{
411-
const struct gpio_chip *chip = dev_get_drvdata(dev);
412+
const struct gpio_chip *chip = dev_get_drvdata(dev);
412413

413414
return sysfs_emit(buf, "%s\n", chip->label ?: "");
414415
}
@@ -417,7 +418,7 @@ static DEVICE_ATTR_RO(label);
417418
static ssize_t ngpio_show(struct device *dev,
418419
struct device_attribute *attr, char *buf)
419420
{
420-
const struct gpio_chip *chip = dev_get_drvdata(dev);
421+
const struct gpio_chip *chip = dev_get_drvdata(dev);
421422

422423
return sysfs_emit(buf, "%u\n", chip->ngpio);
423424
}
@@ -441,11 +442,10 @@ static ssize_t export_store(const struct class *class,
441442
const struct class_attribute *attr,
442443
const char *buf, size_t len)
443444
{
444-
long gpio;
445-
struct gpio_desc *desc;
446-
int status;
447-
struct gpio_chip *gc;
448-
int offset;
445+
struct gpio_desc *desc;
446+
struct gpio_chip *gc;
447+
int status, offset;
448+
long gpio;
449449

450450
status = kstrtol(buf, 0, &gpio);
451451
if (status < 0)
@@ -496,9 +496,9 @@ static ssize_t unexport_store(const struct class *class,
496496
const struct class_attribute *attr,
497497
const char *buf, size_t len)
498498
{
499-
long gpio;
500-
struct gpio_desc *desc;
501-
int status;
499+
struct gpio_desc *desc;
500+
int status;
501+
long gpio;
502502

503503
status = kstrtol(buf, 0, &gpio);
504504
if (status < 0)
@@ -559,14 +559,13 @@ static struct class gpio_class = {
559559
*/
560560
int gpiod_export(struct gpio_desc *desc, bool direction_may_change)
561561
{
562-
struct gpio_chip *chip;
563-
struct gpio_device *gdev;
564-
struct gpiod_data *data;
565-
unsigned long flags;
566-
int status;
567-
const char *ioname = NULL;
568-
struct device *dev;
569-
int offset;
562+
const char *ioname = NULL;
563+
struct gpio_device *gdev;
564+
struct gpiod_data *data;
565+
struct gpio_chip *chip;
566+
unsigned long flags;
567+
struct device *dev;
568+
int status, offset;
570569

571570
/* can't export until sysfs is available ... */
572571
if (!class_is_registered(&gpio_class)) {
@@ -733,9 +732,9 @@ EXPORT_SYMBOL_GPL(gpiod_unexport);
733732

734733
int gpiochip_sysfs_register(struct gpio_device *gdev)
735734
{
736-
struct device *dev;
737-
struct device *parent;
738735
struct gpio_chip *chip = gdev->chip;
736+
struct device *parent;
737+
struct device *dev;
739738

740739
/*
741740
* Many systems add gpio chips for SOC support very early,

0 commit comments

Comments
 (0)