linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mfd: at91-usart: Constify at91_usart_spi_subdev and at91_usart_serial_subdev
@ 2019-01-31  4:32 Axel Lin
  2019-01-31  4:32 ` [PATCH 2/2] mfd: at91-usart: No need to copy mfd_cell in probe Axel Lin
  2019-02-07  7:51 ` [PATCH 1/2] mfd: at91-usart: Constify at91_usart_spi_subdev and at91_usart_serial_subdev Lee Jones
  0 siblings, 2 replies; 4+ messages in thread
From: Axel Lin @ 2019-01-31  4:32 UTC (permalink / raw)
  To: Lee Jones
  Cc: Radu Pirea, Nicolas Ferre, Alexandre Belloni, Ludovic Desroches,
	linux-kernel, Axel Lin

They are never get changed, make them constant.
While at it, fix indent as well.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/mfd/at91-usart.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/mfd/at91-usart.c b/drivers/mfd/at91-usart.c
index d20747f612c1..684d3a8db661 100644
--- a/drivers/mfd/at91-usart.c
+++ b/drivers/mfd/at91-usart.c
@@ -15,15 +15,15 @@
 #include <linux/of.h>
 #include <linux/property.h>
 
-static struct mfd_cell at91_usart_spi_subdev = {
-		.name = "at91_usart_spi",
-		.of_compatible = "microchip,at91sam9g45-usart-spi",
-	};
+static const struct mfd_cell at91_usart_spi_subdev = {
+	.name = "at91_usart_spi",
+	.of_compatible = "microchip,at91sam9g45-usart-spi",
+};
 
-static struct mfd_cell at91_usart_serial_subdev = {
-		.name = "atmel_usart_serial",
-		.of_compatible = "atmel,at91rm9200-usart-serial",
-	};
+static const struct mfd_cell at91_usart_serial_subdev = {
+	.name = "atmel_usart_serial",
+	.of_compatible = "atmel,at91rm9200-usart-serial",
+};
 
 static int at91_usart_mode_probe(struct platform_device *pdev)
 {
-- 
2.17.1


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

* [PATCH 2/2] mfd: at91-usart: No need to copy mfd_cell in probe
  2019-01-31  4:32 [PATCH 1/2] mfd: at91-usart: Constify at91_usart_spi_subdev and at91_usart_serial_subdev Axel Lin
@ 2019-01-31  4:32 ` Axel Lin
  2019-02-07  7:52   ` Lee Jones
  2019-02-07  7:51 ` [PATCH 1/2] mfd: at91-usart: Constify at91_usart_spi_subdev and at91_usart_serial_subdev Lee Jones
  1 sibling, 1 reply; 4+ messages in thread
From: Axel Lin @ 2019-01-31  4:32 UTC (permalink / raw)
  To: Lee Jones
  Cc: Radu Pirea, Nicolas Ferre, Alexandre Belloni, Ludovic Desroches,
	linux-kernel, Axel Lin

Use pointer instead.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/mfd/at91-usart.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/at91-usart.c b/drivers/mfd/at91-usart.c
index 684d3a8db661..6a8351a4588e 100644
--- a/drivers/mfd/at91-usart.c
+++ b/drivers/mfd/at91-usart.c
@@ -27,17 +27,17 @@ static const struct mfd_cell at91_usart_serial_subdev = {
 
 static int at91_usart_mode_probe(struct platform_device *pdev)
 {
-	struct mfd_cell cell;
+	const struct mfd_cell *cell;
 	u32 opmode = AT91_USART_MODE_SERIAL;
 
 	device_property_read_u32(&pdev->dev, "atmel,usart-mode", &opmode);
 
 	switch (opmode) {
 	case AT91_USART_MODE_SPI:
-		cell = at91_usart_spi_subdev;
+		cell = &at91_usart_spi_subdev;
 		break;
 	case AT91_USART_MODE_SERIAL:
-		cell = at91_usart_serial_subdev;
+		cell = &at91_usart_serial_subdev;
 		break;
 	default:
 		dev_err(&pdev->dev, "atmel,usart-mode has an invalid value %u\n",
@@ -45,7 +45,7 @@ static int at91_usart_mode_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
-	return devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO, &cell, 1,
+	return devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO, cell, 1,
 			      NULL, 0, NULL);
 }
 
-- 
2.17.1


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

* Re: [PATCH 1/2] mfd: at91-usart: Constify at91_usart_spi_subdev and at91_usart_serial_subdev
  2019-01-31  4:32 [PATCH 1/2] mfd: at91-usart: Constify at91_usart_spi_subdev and at91_usart_serial_subdev Axel Lin
  2019-01-31  4:32 ` [PATCH 2/2] mfd: at91-usart: No need to copy mfd_cell in probe Axel Lin
@ 2019-02-07  7:51 ` Lee Jones
  1 sibling, 0 replies; 4+ messages in thread
From: Lee Jones @ 2019-02-07  7:51 UTC (permalink / raw)
  To: Axel Lin
  Cc: Radu Pirea, Nicolas Ferre, Alexandre Belloni, Ludovic Desroches,
	linux-kernel

On Thu, 31 Jan 2019, Axel Lin wrote:

> They are never get changed, make them constant.
> While at it, fix indent as well.
> 
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
>  drivers/mfd/at91-usart.c | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)

Applied, thanks.

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH 2/2] mfd: at91-usart: No need to copy mfd_cell in probe
  2019-01-31  4:32 ` [PATCH 2/2] mfd: at91-usart: No need to copy mfd_cell in probe Axel Lin
@ 2019-02-07  7:52   ` Lee Jones
  0 siblings, 0 replies; 4+ messages in thread
From: Lee Jones @ 2019-02-07  7:52 UTC (permalink / raw)
  To: Axel Lin
  Cc: Radu Pirea, Nicolas Ferre, Alexandre Belloni, Ludovic Desroches,
	linux-kernel

On Thu, 31 Jan 2019, Axel Lin wrote:

> Use pointer instead.
> 
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
>  drivers/mfd/at91-usart.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Applied, thanks.

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

end of thread, other threads:[~2019-02-07  7:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-31  4:32 [PATCH 1/2] mfd: at91-usart: Constify at91_usart_spi_subdev and at91_usart_serial_subdev Axel Lin
2019-01-31  4:32 ` [PATCH 2/2] mfd: at91-usart: No need to copy mfd_cell in probe Axel Lin
2019-02-07  7:52   ` Lee Jones
2019-02-07  7:51 ` [PATCH 1/2] mfd: at91-usart: Constify at91_usart_spi_subdev and at91_usart_serial_subdev Lee Jones

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).