[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180914175122.21036-17-rkir@google.com>
Date: Fri, 14 Sep 2018 10:51:18 -0700
From: rkir@...gle.com
To: gregkh@...uxfoundation.org
Cc: tkjos@...gle.com, linux-kernel@...r.kernel.org,
Roman Kiryanov <rkir@...gle.com>
Subject: [PATCH 17/21] platform: goldfish: pipe: Add a dedicated constant for
the device name
From: Roman Kiryanov <rkir@...gle.com>
Create a constant to refer to the device name instead if several copies
of a string.
Signed-off-by: Roman Kiryanov <rkir@...gle.com>
---
drivers/platform/goldfish/goldfish_pipe.h | 2 ++
drivers/platform/goldfish/goldfish_pipe_v2.c | 4 ++--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/platform/goldfish/goldfish_pipe.h b/drivers/platform/goldfish/goldfish_pipe.h
index 41e831f59eff..178efcf52d22 100644
--- a/drivers/platform/goldfish/goldfish_pipe.h
+++ b/drivers/platform/goldfish/goldfish_pipe.h
@@ -16,6 +16,8 @@
#ifndef GOLDFISH_PIPE_H
#define GOLDFISH_PIPE_H
+#define DEVICE_NAME "goldfish_pipe"
+
struct goldfish_pipe_dev_base {
/* the destructor, the pointer is set in init */
int (*deinit)(void *pipe_dev, struct platform_device *pdev);
diff --git a/drivers/platform/goldfish/goldfish_pipe_v2.c b/drivers/platform/goldfish/goldfish_pipe_v2.c
index e3358c682562..2332aa4bfcea 100644
--- a/drivers/platform/goldfish/goldfish_pipe_v2.c
+++ b/drivers/platform/goldfish/goldfish_pipe_v2.c
@@ -1109,7 +1109,7 @@ static void init_miscdevice(struct miscdevice *miscdev)
memset(miscdev, 0, sizeof(*miscdev));
miscdev->minor = MISC_DYNAMIC_MINOR;
- miscdev->name = "goldfish_pipe";
+ miscdev->name = DEVICE_NAME;
miscdev->fops = &goldfish_pipe_fops;
}
@@ -1140,7 +1140,7 @@ int goldfish_pipe_device_v2_init(struct platform_device *pdev,
err = devm_request_irq(&pdev->dev, irq,
goldfish_pipe_interrupt,
- IRQF_SHARED, "goldfish_pipe", dev);
+ IRQF_SHARED, DEVICE_NAME, dev);
if (err) {
dev_err(&pdev->dev, "unable to allocate IRQ for v2\n");
return err;
--
2.19.0.397.gdd90340f6a-goog
Powered by blists - more mailing lists