Skip to content

Commit

Permalink
ledtrig-blkdev: Add function placeholders needed by block changes
Browse files Browse the repository at this point in the history
Add ledtrig_blkdev_disk_init() and ledtrig_blkdev_disk_cleanup()
placeholders.  (Implementations depend on block subsystem changes in
next commit.)

Signed-off-by: Ian Pilcher <arequipeno@gmail.com>
  • Loading branch information
ipilcher authored and intel-lab-lkp committed Sep 3, 2021
1 parent 1763707 commit 555c9bc
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
11 changes: 11 additions & 0 deletions drivers/leds/trigger/ledtrig-blkdev-core.c
Expand Up @@ -6,4 +6,15 @@
* Copyright 2021 Ian Pilcher <arequipeno@gmail.com>
*/

#include <linux/leds.h>

#include "ledtrig-blkdev.h"

/**
* ledtrig_blkdev_disk_cleanup - remove a block device from the blkdev LED
* trigger
* @gd: the disk to be removed
*/
void ledtrig_blkdev_disk_cleanup(struct gendisk *const gd)
{
}
19 changes: 19 additions & 0 deletions include/linux/leds.h
Expand Up @@ -10,6 +10,7 @@

#include <dt-bindings/leds/common.h>
#include <linux/device.h>
#include <linux/genhd.h>
#include <linux/kernfs.h>
#include <linux/list.h>
#include <linux/mutex.h>
Expand Down Expand Up @@ -605,4 +606,22 @@ static inline void ledtrig_audio_set(enum led_audio type,
}
#endif

#if IS_ENABLED(CONFIG_LEDS_TRIGGER_BLKDEV)
/**
* ledtrig_blkdev_disk_init - initialize the ledtrig field of a new gendisk
* @gd: the gendisk to be initialized
*/
static inline void ledtrig_blkdev_disk_init(struct gendisk *const gd)
{
}
void ledtrig_blkdev_disk_cleanup(struct gendisk *const gd);
#else /* CONFIG_LEDS_TRIGGER_BLKDEV */
static inline void ledtrig_blkdev_disk_init(const struct gendisk *gd)
{
}
static inline void ledtrig_blkdev_disk_cleanup(const struct gendisk *gd)
{
}
#endif /* CONFIG_LEDS_TRIGGER_BLKDEV */

#endif /* __LINUX_LEDS_H_INCLUDED */

0 comments on commit 555c9bc

Please sign in to comment.