Skip to content

Commit 8b26b8e

Browse files
andy-shevBartosz Golaszewski
authored andcommitted
gpio: xgene-sb: Remove unneeded definitions for properties
There are three definitions for the property names. Remove them as: 1) each of them is only used once; 2) in all cases the definition is longer than the value. In the result code is better and grepping on the property immediately gets the function in which is being used which helps to guess the type of the value. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent 9eb1e82 commit 8b26b8e

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

drivers/gpio/gpio-xgene-sb.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@
1717

1818
#include "gpiolib-acpi.h"
1919

20-
/* Common property names */
21-
#define XGENE_NIRQ_PROPERTY "apm,nr-irqs"
22-
#define XGENE_NGPIO_PROPERTY "apm,nr-gpios"
23-
#define XGENE_IRQ_START_PROPERTY "apm,irq-start"
24-
2520
#define XGENE_DFLT_MAX_NGPIO 22
2621
#define XGENE_DFLT_MAX_NIRQ 6
2722
#define XGENE_DFLT_IRQ_START_PIN 8
@@ -252,18 +247,17 @@ static int xgene_gpio_sb_probe(struct platform_device *pdev)
252247

253248
/* Retrieve start irq pin, use default if property not found */
254249
priv->irq_start = XGENE_DFLT_IRQ_START_PIN;
255-
if (!device_property_read_u32(&pdev->dev,
256-
XGENE_IRQ_START_PROPERTY, &val32))
250+
if (!device_property_read_u32(&pdev->dev, "apm,irq-start", &val32))
257251
priv->irq_start = val32;
258252

259253
/* Retrieve number irqs, use default if property not found */
260254
priv->nirq = XGENE_DFLT_MAX_NIRQ;
261-
if (!device_property_read_u32(&pdev->dev, XGENE_NIRQ_PROPERTY, &val32))
255+
if (!device_property_read_u32(&pdev->dev, "apm,nr-irqs", &val32))
262256
priv->nirq = val32;
263257

264258
/* Retrieve number gpio, use default if property not found */
265259
priv->gc.ngpio = XGENE_DFLT_MAX_NGPIO;
266-
if (!device_property_read_u32(&pdev->dev, XGENE_NGPIO_PROPERTY, &val32))
260+
if (!device_property_read_u32(&pdev->dev, "apm,nr-gpios", &val32))
267261
priv->gc.ngpio = val32;
268262

269263
dev_info(&pdev->dev, "Support %d gpios, %d irqs start from pin %d\n",

0 commit comments

Comments
 (0)