linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] dmaengine: idma64: Move driver name to the header
@ 2019-04-09 15:02 Andy Shevchenko
  2019-04-09 16:37 ` Christoph Hellwig
  2019-04-26 11:25 ` Vinod Koul
  0 siblings, 2 replies; 4+ messages in thread
From: Andy Shevchenko @ 2019-04-09 15:02 UTC (permalink / raw)
  To: Vinod Koul, dmaengine, Lee Jones, linux-kernel; +Cc: Andy Shevchenko

There are two drivers that are relying on the iDMA 64-bit driver name
to match. Instead of duplicating string in both of them, dedicate
a header file and share it between users.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/dma/idma64.c       |  9 ++++-----
 drivers/mfd/intel-lpss.c   |  4 ++--
 include/linux/dma/idma64.h | 14 ++++++++++++++
 3 files changed, 20 insertions(+), 7 deletions(-)
 create mode 100644 include/linux/dma/idma64.h

diff --git a/drivers/dma/idma64.c b/drivers/dma/idma64.c
index 0baf9797cc09..4180cf197823 100644
--- a/drivers/dma/idma64.c
+++ b/drivers/dma/idma64.c
@@ -19,10 +19,9 @@
 #include <linux/platform_device.h>
 #include <linux/slab.h>
 
-#include "idma64.h"
+#include <linux/dma/idma64.h>
 
-/* Platform driver name */
-#define DRV_NAME		"idma64"
+#include "idma64.h"
 
 /* For now we support only two channels */
 #define IDMA64_NR_CHAN		2
@@ -697,7 +696,7 @@ static struct platform_driver idma64_platform_driver = {
 	.probe		= idma64_platform_probe,
 	.remove		= idma64_platform_remove,
 	.driver = {
-		.name	= DRV_NAME,
+		.name	= LPSS_IDMA64_DRIVER_NAME,
 		.pm	= &idma64_dev_pm_ops,
 	},
 };
@@ -707,4 +706,4 @@ module_platform_driver(idma64_platform_driver);
 MODULE_LICENSE("GPL v2");
 MODULE_DESCRIPTION("iDMA64 core driver");
 MODULE_AUTHOR("Andy Shevchenko <andriy.shevchenko@linux.intel.com>");
-MODULE_ALIAS("platform:" DRV_NAME);
+MODULE_ALIAS("platform:" LPSS_IDMA64_DRIVER_NAME);
diff --git a/drivers/mfd/intel-lpss.c b/drivers/mfd/intel-lpss.c
index 50bffc3382d7..45221e092ecf 100644
--- a/drivers/mfd/intel-lpss.c
+++ b/drivers/mfd/intel-lpss.c
@@ -28,6 +28,8 @@
 #include <linux/seq_file.h>
 #include <linux/io-64-nonatomic-lo-hi.h>
 
+#include <linux/dma/idma64.h>
+
 #include "intel-lpss.h"
 
 #define LPSS_DEV_OFFSET		0x000
@@ -96,8 +98,6 @@ static const struct resource intel_lpss_idma64_resources[] = {
 	DEFINE_RES_IRQ(0),
 };
 
-#define LPSS_IDMA64_DRIVER_NAME		"idma64"
-
 /*
  * Cells needs to be ordered so that the iDMA is created first. This is
  * because we need to be sure the DMA is available when the host controller
diff --git a/include/linux/dma/idma64.h b/include/linux/dma/idma64.h
new file mode 100644
index 000000000000..621cfae60554
--- /dev/null
+++ b/include/linux/dma/idma64.h
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Definitions for the Intel integrated DMA 64-bit
+ *
+ * Copyright (C) 2019 Intel Corporation
+ */
+
+#ifndef __LINUX_DMA_IDMA64_H__
+#define __LINUX_DMA_IDMA64_H__
+
+/* Platform driver name */
+#define LPSS_IDMA64_DRIVER_NAME		"idma64"
+
+#endif /* __LINUX_DMA_IDMA64_H__ */
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] dmaengine: idma64: Move driver name to the header
  2019-04-09 15:02 [PATCH v1] dmaengine: idma64: Move driver name to the header Andy Shevchenko
@ 2019-04-09 16:37 ` Christoph Hellwig
  2019-04-09 18:01   ` Andy Shevchenko
  2019-04-26 11:25 ` Vinod Koul
  1 sibling, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2019-04-09 16:37 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: Vinod Koul, dmaengine, Lee Jones, linux-kernel

On Tue, Apr 09, 2019 at 06:02:19PM +0300, Andy Shevchenko wrote:
> There are two drivers that are relying on the iDMA 64-bit driver name
> to match. Instead of duplicating string in both of them, dedicate
> a header file and share it between users.

Hmm.  Why do we have two separate drivers for the same name?

Something is rather fishy there.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] dmaengine: idma64: Move driver name to the header
  2019-04-09 16:37 ` Christoph Hellwig
@ 2019-04-09 18:01   ` Andy Shevchenko
  0 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2019-04-09 18:01 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Vinod Koul, dmaengine, Lee Jones, linux-kernel

On Tue, Apr 09, 2019 at 09:37:28AM -0700, Christoph Hellwig wrote:
> On Tue, Apr 09, 2019 at 06:02:19PM +0300, Andy Shevchenko wrote:
> > There are two drivers that are relying on the iDMA 64-bit driver name
> > to match. Instead of duplicating string in both of them, dedicate
> > a header file and share it between users.
> 
> Hmm.  Why do we have two separate drivers for the same name?
> 
> Something is rather fishy there.

We would like to be sure that the DMA controller driver is loaded before its
consumers.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] dmaengine: idma64: Move driver name to the header
  2019-04-09 15:02 [PATCH v1] dmaengine: idma64: Move driver name to the header Andy Shevchenko
  2019-04-09 16:37 ` Christoph Hellwig
@ 2019-04-26 11:25 ` Vinod Koul
  1 sibling, 0 replies; 4+ messages in thread
From: Vinod Koul @ 2019-04-26 11:25 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: dmaengine, Lee Jones, linux-kernel

On 09-04-19, 18:02, Andy Shevchenko wrote:
> There are two drivers that are relying on the iDMA 64-bit driver name
> to match. Instead of duplicating string in both of them, dedicate
> a header file and share it between users.

Applied, thanks

-- 
~Vinod

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-04-26 11:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-09 15:02 [PATCH v1] dmaengine: idma64: Move driver name to the header Andy Shevchenko
2019-04-09 16:37 ` Christoph Hellwig
2019-04-09 18:01   ` Andy Shevchenko
2019-04-26 11:25 ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).