Skip to content

Commit ec28a8c

Browse files
Dan Murphypavelmachek
authored andcommitted
leds: core: Remove extern from header
extern is implied and is not needed in the header file. Remove the extern keyword and re-align the code. Signed-off-by: Dan Murphy <[email protected]> Signed-off-by: Pavel Machek <[email protected]>
1 parent e63a744 commit ec28a8c

File tree

1 file changed

+44
-51
lines changed

1 file changed

+44
-51
lines changed

include/linux/leds.h

Lines changed: 44 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ struct led_classdev {
161161
*
162162
* Returns: 0 on success or negative error value on failure
163163
*/
164-
extern int led_classdev_register_ext(struct device *parent,
164+
int led_classdev_register_ext(struct device *parent,
165165
struct led_classdev *led_cdev,
166166
struct led_init_data *init_data);
167167

@@ -181,7 +181,7 @@ static inline int led_classdev_register(struct device *parent,
181181
return led_classdev_register_ext(parent, led_cdev, NULL);
182182
}
183183

184-
extern int devm_led_classdev_register_ext(struct device *parent,
184+
int devm_led_classdev_register_ext(struct device *parent,
185185
struct led_classdev *led_cdev,
186186
struct led_init_data *init_data);
187187

@@ -190,11 +190,11 @@ static inline int devm_led_classdev_register(struct device *parent,
190190
{
191191
return devm_led_classdev_register_ext(parent, led_cdev, NULL);
192192
}
193-
extern void led_classdev_unregister(struct led_classdev *led_cdev);
194-
extern void devm_led_classdev_unregister(struct device *parent,
195-
struct led_classdev *led_cdev);
196-
extern void led_classdev_suspend(struct led_classdev *led_cdev);
197-
extern void led_classdev_resume(struct led_classdev *led_cdev);
193+
void led_classdev_unregister(struct led_classdev *led_cdev);
194+
void devm_led_classdev_unregister(struct device *parent,
195+
struct led_classdev *led_cdev);
196+
void led_classdev_suspend(struct led_classdev *led_cdev);
197+
void led_classdev_resume(struct led_classdev *led_cdev);
198198

199199
/**
200200
* led_blink_set - set blinking with software fallback
@@ -211,9 +211,8 @@ extern void led_classdev_resume(struct led_classdev *led_cdev);
211211
* led_cdev->brightness_set() will not stop the blinking,
212212
* use led_classdev_brightness_set() instead.
213213
*/
214-
extern void led_blink_set(struct led_classdev *led_cdev,
215-
unsigned long *delay_on,
216-
unsigned long *delay_off);
214+
void led_blink_set(struct led_classdev *led_cdev, unsigned long *delay_on,
215+
unsigned long *delay_off);
217216
/**
218217
* led_blink_set_oneshot - do a oneshot software blink
219218
* @led_cdev: the LED to start blinking
@@ -228,10 +227,9 @@ extern void led_blink_set(struct led_classdev *led_cdev,
228227
* If invert is set, led blinks for delay_off first, then for
229228
* delay_on and leave the led on after the on-off cycle.
230229
*/
231-
extern void led_blink_set_oneshot(struct led_classdev *led_cdev,
232-
unsigned long *delay_on,
233-
unsigned long *delay_off,
234-
int invert);
230+
void led_blink_set_oneshot(struct led_classdev *led_cdev,
231+
unsigned long *delay_on, unsigned long *delay_off,
232+
int invert);
235233
/**
236234
* led_set_brightness - set LED brightness
237235
* @led_cdev: the LED to set
@@ -241,8 +239,8 @@ extern void led_blink_set_oneshot(struct led_classdev *led_cdev,
241239
* software blink timer that implements blinking when the
242240
* hardware doesn't. This function is guaranteed not to sleep.
243241
*/
244-
extern void led_set_brightness(struct led_classdev *led_cdev,
245-
enum led_brightness brightness);
242+
void led_set_brightness(struct led_classdev *led_cdev,
243+
enum led_brightness brightness);
246244

247245
/**
248246
* led_set_brightness_sync - set LED brightness synchronously
@@ -255,8 +253,8 @@ extern void led_set_brightness(struct led_classdev *led_cdev,
255253
*
256254
* Returns: 0 on success or negative error value on failure
257255
*/
258-
extern int led_set_brightness_sync(struct led_classdev *led_cdev,
259-
enum led_brightness value);
256+
int led_set_brightness_sync(struct led_classdev *led_cdev,
257+
enum led_brightness value);
260258

261259
/**
262260
* led_update_brightness - update LED brightness
@@ -267,7 +265,7 @@ extern int led_set_brightness_sync(struct led_classdev *led_cdev,
267265
*
268266
* Returns: 0 on success or negative error value on failure
269267
*/
270-
extern int led_update_brightness(struct led_classdev *led_cdev);
268+
int led_update_brightness(struct led_classdev *led_cdev);
271269

272270
/**
273271
* led_get_default_pattern - return default pattern
@@ -279,24 +277,23 @@ extern int led_update_brightness(struct led_classdev *led_cdev);
279277
* Return: Allocated array of integers with default pattern from device tree
280278
* or NULL. Caller is responsible for kfree().
281279
*/
282-
extern u32 *led_get_default_pattern(struct led_classdev *led_cdev,
283-
unsigned int *size);
280+
u32 *led_get_default_pattern(struct led_classdev *led_cdev, unsigned int *size);
284281

285282
/**
286283
* led_sysfs_disable - disable LED sysfs interface
287284
* @led_cdev: the LED to set
288285
*
289286
* Disable the led_cdev's sysfs interface.
290287
*/
291-
extern void led_sysfs_disable(struct led_classdev *led_cdev);
288+
void led_sysfs_disable(struct led_classdev *led_cdev);
292289

293290
/**
294291
* led_sysfs_enable - enable LED sysfs interface
295292
* @led_cdev: the LED to set
296293
*
297294
* Enable the led_cdev's sysfs interface.
298295
*/
299-
extern void led_sysfs_enable(struct led_classdev *led_cdev);
296+
void led_sysfs_enable(struct led_classdev *led_cdev);
300297

301298
/**
302299
* led_compose_name - compose LED class device name
@@ -311,8 +308,8 @@ extern void led_sysfs_enable(struct led_classdev *led_cdev);
311308
*
312309
* Returns: 0 on success or negative error value on failure
313310
*/
314-
extern int led_compose_name(struct device *dev, struct led_init_data *init_data,
315-
char *led_classdev_name);
311+
int led_compose_name(struct device *dev, struct led_init_data *init_data,
312+
char *led_classdev_name);
316313

317314
/**
318315
* led_sysfs_is_disabled - check if LED sysfs interface is disabled
@@ -362,27 +359,24 @@ struct led_trigger {
362359
#define led_trigger_get_drvdata(dev) (led_get_trigger_data(led_trigger_get_led(dev)))
363360

364361
/* Registration functions for complex triggers */
365-
extern int led_trigger_register(struct led_trigger *trigger);
366-
extern void led_trigger_unregister(struct led_trigger *trigger);
367-
extern int devm_led_trigger_register(struct device *dev,
362+
int led_trigger_register(struct led_trigger *trigger);
363+
void led_trigger_unregister(struct led_trigger *trigger);
364+
int devm_led_trigger_register(struct device *dev,
368365
struct led_trigger *trigger);
369366

370-
extern void led_trigger_register_simple(const char *name,
367+
void led_trigger_register_simple(const char *name,
371368
struct led_trigger **trigger);
372-
extern void led_trigger_unregister_simple(struct led_trigger *trigger);
373-
extern void led_trigger_event(struct led_trigger *trigger,
374-
enum led_brightness event);
375-
extern void led_trigger_blink(struct led_trigger *trigger,
376-
unsigned long *delay_on,
377-
unsigned long *delay_off);
378-
extern void led_trigger_blink_oneshot(struct led_trigger *trigger,
379-
unsigned long *delay_on,
380-
unsigned long *delay_off,
381-
int invert);
382-
extern void led_trigger_set_default(struct led_classdev *led_cdev);
383-
extern int led_trigger_set(struct led_classdev *led_cdev,
384-
struct led_trigger *trigger);
385-
extern void led_trigger_remove(struct led_classdev *led_cdev);
369+
void led_trigger_unregister_simple(struct led_trigger *trigger);
370+
void led_trigger_event(struct led_trigger *trigger, enum led_brightness event);
371+
void led_trigger_blink(struct led_trigger *trigger, unsigned long *delay_on,
372+
unsigned long *delay_off);
373+
void led_trigger_blink_oneshot(struct led_trigger *trigger,
374+
unsigned long *delay_on,
375+
unsigned long *delay_off,
376+
int invert);
377+
void led_trigger_set_default(struct led_classdev *led_cdev);
378+
int led_trigger_set(struct led_classdev *led_cdev, struct led_trigger *trigger);
379+
void led_trigger_remove(struct led_classdev *led_cdev);
386380

387381
static inline void led_set_trigger_data(struct led_classdev *led_cdev,
388382
void *trigger_data)
@@ -410,8 +404,7 @@ static inline void *led_get_trigger_data(struct led_classdev *led_cdev)
410404
* This is meant to be used on triggers with statically
411405
* allocated name.
412406
*/
413-
extern void led_trigger_rename_static(const char *name,
414-
struct led_trigger *trig);
407+
void led_trigger_rename_static(const char *name, struct led_trigger *trig);
415408

416409
#define module_led_trigger(__led_trigger) \
417410
module_driver(__led_trigger, led_trigger_register, \
@@ -453,20 +446,20 @@ static inline void *led_get_trigger_data(struct led_classdev *led_cdev)
453446

454447
/* Trigger specific functions */
455448
#ifdef CONFIG_LEDS_TRIGGER_DISK
456-
extern void ledtrig_disk_activity(bool write);
449+
void ledtrig_disk_activity(bool write);
457450
#else
458451
static inline void ledtrig_disk_activity(bool write) {}
459452
#endif
460453

461454
#ifdef CONFIG_LEDS_TRIGGER_MTD
462-
extern void ledtrig_mtd_activity(void);
455+
void ledtrig_mtd_activity(void);
463456
#else
464457
static inline void ledtrig_mtd_activity(void) {}
465458
#endif
466459

467460
#if defined(CONFIG_LEDS_TRIGGER_CAMERA) || defined(CONFIG_LEDS_TRIGGER_CAMERA_MODULE)
468-
extern void ledtrig_flash_ctrl(bool on);
469-
extern void ledtrig_torch_ctrl(bool on);
461+
void ledtrig_flash_ctrl(bool on);
462+
void ledtrig_torch_ctrl(bool on);
470463
#else
471464
static inline void ledtrig_flash_ctrl(bool on) {}
472465
static inline void ledtrig_torch_ctrl(bool on) {}
@@ -546,7 +539,7 @@ enum cpu_led_event {
546539
CPU_LED_HALTED, /* Machine shutdown */
547540
};
548541
#ifdef CONFIG_LEDS_TRIGGER_CPU
549-
extern void ledtrig_cpu(enum cpu_led_event evt);
542+
void ledtrig_cpu(enum cpu_led_event evt);
550543
#else
551544
static inline void ledtrig_cpu(enum cpu_led_event evt)
552545
{
@@ -555,7 +548,7 @@ static inline void ledtrig_cpu(enum cpu_led_event evt)
555548
#endif
556549

557550
#ifdef CONFIG_LEDS_BRIGHTNESS_HW_CHANGED
558-
extern void led_classdev_notify_brightness_hw_changed(
551+
void led_classdev_notify_brightness_hw_changed(
559552
struct led_classdev *led_cdev, enum led_brightness brightness);
560553
#else
561554
static inline void led_classdev_notify_brightness_hw_changed(

0 commit comments

Comments
 (0)