linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] Extend the SPI mem interface to set a custom memory name
@ 2018-08-02 12:53 Frieder Schrempf
  2018-08-02 12:53 ` [PATCH v3 1/3] spi: spi-mem: Fix a typo in the documentation of struct spi_mem Frieder Schrempf
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Frieder Schrempf @ 2018-08-02 12:53 UTC (permalink / raw)
  To: dwmw2, computersforpeace, boris.brezillon, marek.vasut, richard,
	broonie, linux-mtd, linux-spi
  Cc: cyrille.pitchen, frieder.schrempf, pp, Zhiqiang.Hou, linux-kernel

These changes were previously send with the series that transforms the FSL QSPI
driver to the SPI mem interface [1]. As these changes are needed for other
drivers too I send them separately now.

The first patch fixes a typo, the second extends the interface to set and get a
custom name for the memory device and the third patch makes use of this in the
m25p80 driver.

[1] https://patchwork.ozlabs.org/cover/939864/

Changes in v3:
==============
* Move fix for typo in spi-mem.h to a separate patch
* Fix documentation of spi_mem_get_name() and get_name()
* Avoid overwriting the name of the memory device in probe of m25p80
* Add Suggested-by tags

Changes in v2:
==============
* Add a name field to struct spi_mem and fill it while probing

Frieder Schrempf (3):
  spi: spi-mem: Fix a typo in the documentation of struct spi_mem
  spi: spi-mem: Extend the SPI mem interface to set a custom memory name
  mtd: m25p80: Call spi_mem_get_name() to let controller set a custom
    name

 drivers/mtd/devices/m25p80.c |  3 +++
 drivers/spi/spi-mem.c        | 28 ++++++++++++++++++++++++++++
 include/linux/spi/spi-mem.h  | 14 +++++++++++++-
 3 files changed, 44 insertions(+), 1 deletion(-)

-- 
2.7.4


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

* [PATCH v3 1/3] spi: spi-mem: Fix a typo in the documentation of struct spi_mem
  2018-08-02 12:53 [PATCH v3 0/3] Extend the SPI mem interface to set a custom memory name Frieder Schrempf
@ 2018-08-02 12:53 ` Frieder Schrempf
  2018-08-02 13:09   ` Boris Brezillon
  2018-08-02 14:58   ` Applied "spi: spi-mem: Fix a typo in the documentation of struct spi_mem" to the spi tree Mark Brown
  2018-08-02 12:53 ` [PATCH v3 2/3] spi: spi-mem: Extend the SPI mem interface to set a custom memory name Frieder Schrempf
  2018-08-02 12:53 ` [PATCH v3 3/3] mtd: m25p80: Call spi_mem_get_name() to let controller set a custom name Frieder Schrempf
  2 siblings, 2 replies; 11+ messages in thread
From: Frieder Schrempf @ 2018-08-02 12:53 UTC (permalink / raw)
  To: dwmw2, computersforpeace, boris.brezillon, marek.vasut, richard,
	broonie, linux-mtd, linux-spi
  Cc: cyrille.pitchen, frieder.schrempf, pp, Zhiqiang.Hou, linux-kernel

Signed-off-by: Frieder Schrempf <frieder.schrempf@exceet.de>
---
 include/linux/spi/spi-mem.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/spi/spi-mem.h b/include/linux/spi/spi-mem.h
index 4fa34a2..72cc9bc 100644
--- a/include/linux/spi/spi-mem.h
+++ b/include/linux/spi/spi-mem.h
@@ -124,7 +124,7 @@ struct spi_mem_op {
 /**
  * struct spi_mem - describes a SPI memory device
  * @spi: the underlying SPI device
- * @drvpriv: spi_mem_drviver private data
+ * @drvpriv: spi_mem_driver private data
  *
  * Extra information that describe the SPI memory device and may be needed by
  * the controller to properly handle this device should be placed here.
-- 
2.7.4


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

* [PATCH v3 2/3] spi: spi-mem: Extend the SPI mem interface to set a custom memory name
  2018-08-02 12:53 [PATCH v3 0/3] Extend the SPI mem interface to set a custom memory name Frieder Schrempf
  2018-08-02 12:53 ` [PATCH v3 1/3] spi: spi-mem: Fix a typo in the documentation of struct spi_mem Frieder Schrempf
@ 2018-08-02 12:53 ` Frieder Schrempf
  2018-08-02 13:12   ` Boris Brezillon
  2018-08-02 12:53 ` [PATCH v3 3/3] mtd: m25p80: Call spi_mem_get_name() to let controller set a custom name Frieder Schrempf
  2 siblings, 1 reply; 11+ messages in thread
From: Frieder Schrempf @ 2018-08-02 12:53 UTC (permalink / raw)
  To: dwmw2, computersforpeace, boris.brezillon, marek.vasut, richard,
	broonie, linux-mtd, linux-spi
  Cc: cyrille.pitchen, frieder.schrempf, pp, Zhiqiang.Hou, linux-kernel

When porting (Q)SPI controller drivers from the MTD layer to the SPI
layer, the naming scheme for the memory devices changes. To be able
to keep compatibility with the old drivers naming scheme, a name
field is added to struct spi_mem and a hook is added to let controller
drivers set a custom name for the memory device.

Example for the FSL QSPI driver:

Name with the old driver: 21e0000.qspi,
or with multiple devices: 21e0000.qspi-0, 21e0000.qspi-1, ...

Name with the new driver without spi_mem_get_name: spi4.0

Suggested-by: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Frieder Schrempf <frieder.schrempf@exceet.de>
---
 drivers/spi/spi-mem.c       | 28 ++++++++++++++++++++++++++++
 include/linux/spi/spi-mem.h | 12 ++++++++++++
 2 files changed, 40 insertions(+)

diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c
index 990770d..e43842c 100644
--- a/drivers/spi/spi-mem.c
+++ b/drivers/spi/spi-mem.c
@@ -311,6 +311,24 @@ int spi_mem_exec_op(struct spi_mem *mem, const struct spi_mem_op *op)
 EXPORT_SYMBOL_GPL(spi_mem_exec_op);
 
 /**
+ * spi_mem_get_name() - Return the SPI mem device name to be used by the
+ *			upper layer if necessary
+ * @mem: the SPI memory
+ *
+ * This function allows SPI mem users to retrieve the SPI mem device name.
+ * It is useful if the upper layer needs to expose a custom name for
+ * compatibility reasons.
+ *
+ * Return: a string containing the name of the memory device to be used
+ *	   by the SPI mem user
+ */
+const char *spi_mem_get_name(struct spi_mem *mem)
+{
+	return mem->name;
+}
+EXPORT_SYMBOL_GPL(spi_mem_get_name);
+
+/**
  * spi_mem_adjust_op_size() - Adjust the data size of a SPI mem operation to
  *			      match controller limitations
  * @mem: the SPI memory
@@ -344,6 +362,7 @@ static inline struct spi_mem_driver *to_spi_mem_drv(struct device_driver *drv)
 static int spi_mem_probe(struct spi_device *spi)
 {
 	struct spi_mem_driver *memdrv = to_spi_mem_drv(spi->dev.driver);
+	struct spi_controller *ctlr = spi->controller;
 	struct spi_mem *mem;
 
 	mem = devm_kzalloc(&spi->dev, sizeof(*mem), GFP_KERNEL);
@@ -351,6 +370,15 @@ static int spi_mem_probe(struct spi_device *spi)
 		return -ENOMEM;
 
 	mem->spi = spi;
+
+	if (ctlr->mem_ops && ctlr->mem_ops->get_name)
+		mem->name = ctlr->mem_ops->get_name(mem);
+	else
+		mem->name = dev_name(&spi->dev);
+
+	if (IS_ERR_OR_NULL(mem->name))
+		return PTR_ERR(mem->name);
+
 	spi_set_drvdata(spi, mem);
 
 	return memdrv->probe(mem);
diff --git a/include/linux/spi/spi-mem.h b/include/linux/spi/spi-mem.h
index 72cc9bc..0d41826 100644
--- a/include/linux/spi/spi-mem.h
+++ b/include/linux/spi/spi-mem.h
@@ -125,6 +125,7 @@ struct spi_mem_op {
  * struct spi_mem - describes a SPI memory device
  * @spi: the underlying SPI device
  * @drvpriv: spi_mem_driver private data
+ * @name: name of the SPI memory device
  *
  * Extra information that describe the SPI memory device and may be needed by
  * the controller to properly handle this device should be placed here.
@@ -135,6 +136,7 @@ struct spi_mem_op {
 struct spi_mem {
 	struct spi_device *spi;
 	void *drvpriv;
+	char *name;
 };
 
 /**
@@ -167,6 +169,13 @@ static inline void *spi_mem_get_drvdata(struct spi_mem *mem)
  *		    limitations)
  * @supports_op: check if an operation is supported by the controller
  * @exec_op: execute a SPI memory operation
+ * @get_name: get a custom name for the SPI mem device from the controller.
+ *	      This might be needed if the controller driver has been ported
+ *	      to use the SPI mem layer and a custom name is used to keep
+ *	      mtdparts compatible.
+ *	      Note that if the implementation of this function allocates memory
+ *	      dynamically, then it should do so with devm_xxx(), as we don't
+ *	      have a ->free_name() function.
  *
  * This interface should be implemented by SPI controllers providing an
  * high-level interface to execute SPI memory operation, which is usually the
@@ -178,6 +187,7 @@ struct spi_controller_mem_ops {
 			    const struct spi_mem_op *op);
 	int (*exec_op)(struct spi_mem *mem,
 		       const struct spi_mem_op *op);
+	const char *(*get_name)(struct spi_mem *mem);
 };
 
 /**
@@ -236,6 +246,8 @@ bool spi_mem_supports_op(struct spi_mem *mem,
 int spi_mem_exec_op(struct spi_mem *mem,
 		    const struct spi_mem_op *op);
 
+const char *spi_mem_get_name(struct spi_mem *mem);
+
 int spi_mem_driver_register_with_owner(struct spi_mem_driver *drv,
 				       struct module *owner);
 
-- 
2.7.4


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

* [PATCH v3 3/3] mtd: m25p80: Call spi_mem_get_name() to let controller set a custom name
  2018-08-02 12:53 [PATCH v3 0/3] Extend the SPI mem interface to set a custom memory name Frieder Schrempf
  2018-08-02 12:53 ` [PATCH v3 1/3] spi: spi-mem: Fix a typo in the documentation of struct spi_mem Frieder Schrempf
  2018-08-02 12:53 ` [PATCH v3 2/3] spi: spi-mem: Extend the SPI mem interface to set a custom memory name Frieder Schrempf
@ 2018-08-02 12:53 ` Frieder Schrempf
  2018-08-02 13:14   ` Boris Brezillon
  2018-08-02 14:58   ` Applied "mtd: m25p80: Call spi_mem_get_name() to let controller set a custom name" to the spi tree Mark Brown
  2 siblings, 2 replies; 11+ messages in thread
From: Frieder Schrempf @ 2018-08-02 12:53 UTC (permalink / raw)
  To: dwmw2, computersforpeace, boris.brezillon, marek.vasut, richard,
	broonie, linux-mtd, linux-spi
  Cc: cyrille.pitchen, frieder.schrempf, pp, Zhiqiang.Hou, linux-kernel

By calling spi_mem_get_name(), the driver of the (Q)SPI controller can
set a custom name for the memory device if necessary.
This is useful to keep mtdparts compatible when controller drivers are
ported from the MTD to the SPI layer.

Suggested-by: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Frieder Schrempf <frieder.schrempf@exceet.de>
---
 drivers/mtd/devices/m25p80.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index e84563d..aac48800 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -202,6 +202,9 @@ static int m25p_probe(struct spi_mem *spimem)
 	if (data && data->name)
 		nor->mtd.name = data->name;
 
+	if (!nor->mtd.name)
+		nor->mtd.name = spi_mem_get_name(spimem);
+
 	/* For some (historical?) reason many platforms provide two different
 	 * names in flash_platform_data: "name" and "type". Quite often name is
 	 * set to "m25p80" and then "type" provides a real chip name.
-- 
2.7.4


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

* Re: [PATCH v3 1/3] spi: spi-mem: Fix a typo in the documentation of struct spi_mem
  2018-08-02 12:53 ` [PATCH v3 1/3] spi: spi-mem: Fix a typo in the documentation of struct spi_mem Frieder Schrempf
@ 2018-08-02 13:09   ` Boris Brezillon
  2018-08-02 13:39     ` Frieder Schrempf
  2018-08-02 14:58   ` Applied "spi: spi-mem: Fix a typo in the documentation of struct spi_mem" to the spi tree Mark Brown
  1 sibling, 1 reply; 11+ messages in thread
From: Boris Brezillon @ 2018-08-02 13:09 UTC (permalink / raw)
  To: Frieder Schrempf
  Cc: dwmw2, computersforpeace, marek.vasut, richard, broonie,
	linux-mtd, linux-spi, cyrille.pitchen, pp, Zhiqiang.Hou,
	linux-kernel

On Thu,  2 Aug 2018 14:53:52 +0200
Frieder Schrempf <frieder.schrempf@exceet.de> wrote:

We usually try to avoid empty commit message, even if this one is
pretty obvious, I'd suggest adding something here.

"
Fix a typo in the @drvpriv description.
"

?

> Signed-off-by: Frieder Schrempf <frieder.schrempf@exceet.de>

Acked-by: Boris Brezillon <boris.brezillon@bootlin.com>

> ---
>  include/linux/spi/spi-mem.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/spi/spi-mem.h b/include/linux/spi/spi-mem.h
> index 4fa34a2..72cc9bc 100644
> --- a/include/linux/spi/spi-mem.h
> +++ b/include/linux/spi/spi-mem.h
> @@ -124,7 +124,7 @@ struct spi_mem_op {
>  /**
>   * struct spi_mem - describes a SPI memory device
>   * @spi: the underlying SPI device
> - * @drvpriv: spi_mem_drviver private data
> + * @drvpriv: spi_mem_driver private data
>   *
>   * Extra information that describe the SPI memory device and may be needed by
>   * the controller to properly handle this device should be placed here.


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

* Re: [PATCH v3 2/3] spi: spi-mem: Extend the SPI mem interface to set a custom memory name
  2018-08-02 12:53 ` [PATCH v3 2/3] spi: spi-mem: Extend the SPI mem interface to set a custom memory name Frieder Schrempf
@ 2018-08-02 13:12   ` Boris Brezillon
  0 siblings, 0 replies; 11+ messages in thread
From: Boris Brezillon @ 2018-08-02 13:12 UTC (permalink / raw)
  To: Frieder Schrempf
  Cc: dwmw2, computersforpeace, marek.vasut, richard, broonie,
	linux-mtd, linux-spi, cyrille.pitchen, pp, Zhiqiang.Hou,
	linux-kernel

On Thu,  2 Aug 2018 14:53:53 +0200
Frieder Schrempf <frieder.schrempf@exceet.de> wrote:

> When porting (Q)SPI controller drivers from the MTD layer to the SPI
> layer, the naming scheme for the memory devices changes. To be able
> to keep compatibility with the old drivers naming scheme, a name
> field is added to struct spi_mem and a hook is added to let controller
> drivers set a custom name for the memory device.
> 
> Example for the FSL QSPI driver:
> 
> Name with the old driver: 21e0000.qspi,
> or with multiple devices: 21e0000.qspi-0, 21e0000.qspi-1, ...
> 
> Name with the new driver without spi_mem_get_name: spi4.0
> 
> Suggested-by: Boris Brezillon <boris.brezillon@bootlin.com>
> Signed-off-by: Frieder Schrempf <frieder.schrempf@exceet.de>

Reviewed-by: Boris Brezillon <boris.brezillon@bootlin.com>

> ---
>  drivers/spi/spi-mem.c       | 28 ++++++++++++++++++++++++++++
>  include/linux/spi/spi-mem.h | 12 ++++++++++++
>  2 files changed, 40 insertions(+)
> 
> diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c
> index 990770d..e43842c 100644
> --- a/drivers/spi/spi-mem.c
> +++ b/drivers/spi/spi-mem.c
> @@ -311,6 +311,24 @@ int spi_mem_exec_op(struct spi_mem *mem, const struct spi_mem_op *op)
>  EXPORT_SYMBOL_GPL(spi_mem_exec_op);
>  
>  /**
> + * spi_mem_get_name() - Return the SPI mem device name to be used by the
> + *			upper layer if necessary
> + * @mem: the SPI memory
> + *
> + * This function allows SPI mem users to retrieve the SPI mem device name.
> + * It is useful if the upper layer needs to expose a custom name for
> + * compatibility reasons.
> + *
> + * Return: a string containing the name of the memory device to be used
> + *	   by the SPI mem user
> + */
> +const char *spi_mem_get_name(struct spi_mem *mem)
> +{
> +	return mem->name;
> +}
> +EXPORT_SYMBOL_GPL(spi_mem_get_name);
> +
> +/**
>   * spi_mem_adjust_op_size() - Adjust the data size of a SPI mem operation to
>   *			      match controller limitations
>   * @mem: the SPI memory
> @@ -344,6 +362,7 @@ static inline struct spi_mem_driver *to_spi_mem_drv(struct device_driver *drv)
>  static int spi_mem_probe(struct spi_device *spi)
>  {
>  	struct spi_mem_driver *memdrv = to_spi_mem_drv(spi->dev.driver);
> +	struct spi_controller *ctlr = spi->controller;
>  	struct spi_mem *mem;
>  
>  	mem = devm_kzalloc(&spi->dev, sizeof(*mem), GFP_KERNEL);
> @@ -351,6 +370,15 @@ static int spi_mem_probe(struct spi_device *spi)
>  		return -ENOMEM;
>  
>  	mem->spi = spi;
> +
> +	if (ctlr->mem_ops && ctlr->mem_ops->get_name)
> +		mem->name = ctlr->mem_ops->get_name(mem);
> +	else
> +		mem->name = dev_name(&spi->dev);
> +
> +	if (IS_ERR_OR_NULL(mem->name))
> +		return PTR_ERR(mem->name);
> +
>  	spi_set_drvdata(spi, mem);
>  
>  	return memdrv->probe(mem);
> diff --git a/include/linux/spi/spi-mem.h b/include/linux/spi/spi-mem.h
> index 72cc9bc..0d41826 100644
> --- a/include/linux/spi/spi-mem.h
> +++ b/include/linux/spi/spi-mem.h
> @@ -125,6 +125,7 @@ struct spi_mem_op {
>   * struct spi_mem - describes a SPI memory device
>   * @spi: the underlying SPI device
>   * @drvpriv: spi_mem_driver private data
> + * @name: name of the SPI memory device
>   *
>   * Extra information that describe the SPI memory device and may be needed by
>   * the controller to properly handle this device should be placed here.
> @@ -135,6 +136,7 @@ struct spi_mem_op {
>  struct spi_mem {
>  	struct spi_device *spi;
>  	void *drvpriv;
> +	char *name;
>  };
>  
>  /**
> @@ -167,6 +169,13 @@ static inline void *spi_mem_get_drvdata(struct spi_mem *mem)
>   *		    limitations)
>   * @supports_op: check if an operation is supported by the controller
>   * @exec_op: execute a SPI memory operation
> + * @get_name: get a custom name for the SPI mem device from the controller.
> + *	      This might be needed if the controller driver has been ported
> + *	      to use the SPI mem layer and a custom name is used to keep
> + *	      mtdparts compatible.
> + *	      Note that if the implementation of this function allocates memory
> + *	      dynamically, then it should do so with devm_xxx(), as we don't
> + *	      have a ->free_name() function.
>   *
>   * This interface should be implemented by SPI controllers providing an
>   * high-level interface to execute SPI memory operation, which is usually the
> @@ -178,6 +187,7 @@ struct spi_controller_mem_ops {
>  			    const struct spi_mem_op *op);
>  	int (*exec_op)(struct spi_mem *mem,
>  		       const struct spi_mem_op *op);
> +	const char *(*get_name)(struct spi_mem *mem);
>  };
>  
>  /**
> @@ -236,6 +246,8 @@ bool spi_mem_supports_op(struct spi_mem *mem,
>  int spi_mem_exec_op(struct spi_mem *mem,
>  		    const struct spi_mem_op *op);
>  
> +const char *spi_mem_get_name(struct spi_mem *mem);
> +
>  int spi_mem_driver_register_with_owner(struct spi_mem_driver *drv,
>  				       struct module *owner);
>  


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

* Re: [PATCH v3 3/3] mtd: m25p80: Call spi_mem_get_name() to let controller set a custom name
  2018-08-02 12:53 ` [PATCH v3 3/3] mtd: m25p80: Call spi_mem_get_name() to let controller set a custom name Frieder Schrempf
@ 2018-08-02 13:14   ` Boris Brezillon
  2018-08-02 14:58   ` Applied "mtd: m25p80: Call spi_mem_get_name() to let controller set a custom name" to the spi tree Mark Brown
  1 sibling, 0 replies; 11+ messages in thread
From: Boris Brezillon @ 2018-08-02 13:14 UTC (permalink / raw)
  To: Frieder Schrempf
  Cc: dwmw2, computersforpeace, marek.vasut, richard, broonie,
	linux-mtd, linux-spi, cyrille.pitchen, pp, Zhiqiang.Hou,
	linux-kernel

On Thu,  2 Aug 2018 14:53:54 +0200
Frieder Schrempf <frieder.schrempf@exceet.de> wrote:

> By calling spi_mem_get_name(), the driver of the (Q)SPI controller can
> set a custom name for the memory device if necessary.
> This is useful to keep mtdparts compatible when controller drivers are
> ported from the MTD to the SPI layer.
> 
> Suggested-by: Boris Brezillon <boris.brezillon@bootlin.com>
> Signed-off-by: Frieder Schrempf <frieder.schrempf@exceet.de>

Acked-by: Boris Brezillon <boris.brezillon@bootlin.com>

> ---
>  drivers/mtd/devices/m25p80.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
> index e84563d..aac48800 100644
> --- a/drivers/mtd/devices/m25p80.c
> +++ b/drivers/mtd/devices/m25p80.c
> @@ -202,6 +202,9 @@ static int m25p_probe(struct spi_mem *spimem)
>  	if (data && data->name)
>  		nor->mtd.name = data->name;
>  
> +	if (!nor->mtd.name)
> +		nor->mtd.name = spi_mem_get_name(spimem);
> +
>  	/* For some (historical?) reason many platforms provide two different
>  	 * names in flash_platform_data: "name" and "type". Quite often name is
>  	 * set to "m25p80" and then "type" provides a real chip name.


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

* Re: [PATCH v3 1/3] spi: spi-mem: Fix a typo in the documentation of struct spi_mem
  2018-08-02 13:09   ` Boris Brezillon
@ 2018-08-02 13:39     ` Frieder Schrempf
  2018-08-02 14:35       ` Mark Brown
  0 siblings, 1 reply; 11+ messages in thread
From: Frieder Schrempf @ 2018-08-02 13:39 UTC (permalink / raw)
  To: Boris Brezillon, broonie
  Cc: dwmw2, computersforpeace, marek.vasut, richard, linux-mtd,
	linux-spi, cyrille.pitchen, pp, Zhiqiang.Hou, linux-kernel

Hi Boris, hi Mark,

On 02.08.2018 15:09, Boris Brezillon wrote:
> On Thu,  2 Aug 2018 14:53:52 +0200
> Frieder Schrempf <frieder.schrempf@exceet.de> wrote:
> 
> We usually try to avoid empty commit message, even if this one is
> pretty obvious, I'd suggest adding something here.
> 
> "
> Fix a typo in the @drvpriv description.
> "
> 
> ?

Forgot the commit message, sorry.

Mark, can you add it when you apply the patch or should I send a new 
version?

Thanks,
Frieder

> 
>> Signed-off-by: Frieder Schrempf <frieder.schrempf@exceet.de>
> 
> Acked-by: Boris Brezillon <boris.brezillon@bootlin.com>
> 
>> ---
>>   include/linux/spi/spi-mem.h | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/include/linux/spi/spi-mem.h b/include/linux/spi/spi-mem.h
>> index 4fa34a2..72cc9bc 100644
>> --- a/include/linux/spi/spi-mem.h
>> +++ b/include/linux/spi/spi-mem.h
>> @@ -124,7 +124,7 @@ struct spi_mem_op {
>>   /**
>>    * struct spi_mem - describes a SPI memory device
>>    * @spi: the underlying SPI device
>> - * @drvpriv: spi_mem_drviver private data
>> + * @drvpriv: spi_mem_driver private data
>>    *
>>    * Extra information that describe the SPI memory device and may be needed by
>>    * the controller to properly handle this device should be placed here.
> 

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

* Re: [PATCH v3 1/3] spi: spi-mem: Fix a typo in the documentation of struct spi_mem
  2018-08-02 13:39     ` Frieder Schrempf
@ 2018-08-02 14:35       ` Mark Brown
  0 siblings, 0 replies; 11+ messages in thread
From: Mark Brown @ 2018-08-02 14:35 UTC (permalink / raw)
  To: Frieder Schrempf
  Cc: Boris Brezillon, dwmw2, computersforpeace, marek.vasut, richard,
	linux-mtd, linux-spi, cyrille.pitchen, pp, Zhiqiang.Hou,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 305 bytes --]

On Thu, Aug 02, 2018 at 03:39:18PM +0200, Frieder Schrempf wrote:

> Mark, can you add it when you apply the patch or should I send a new
> version?

I'd applied before I saw this subthread, Boris is right that it is
better but for something this obvious I'm not sufficiently bothered by
the missing log.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Applied "mtd: m25p80: Call spi_mem_get_name() to let controller set a custom name" to the spi tree
  2018-08-02 12:53 ` [PATCH v3 3/3] mtd: m25p80: Call spi_mem_get_name() to let controller set a custom name Frieder Schrempf
  2018-08-02 13:14   ` Boris Brezillon
@ 2018-08-02 14:58   ` Mark Brown
  1 sibling, 0 replies; 11+ messages in thread
From: Mark Brown @ 2018-08-02 14:58 UTC (permalink / raw)
  To: Frieder Schrempf
  Cc: Boris Brezillon, Mark Brown, dwmw2, computersforpeace,
	boris.brezillon, marek.vasut, richard, broonie, linux-mtd,
	linux-spi, cyrille.pitchen, frieder.schrempf, pp, Zhiqiang.Hou,
	linux-kernel, linux-spi

The patch

   mtd: m25p80: Call spi_mem_get_name() to let controller set a custom name

has been applied to the spi tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From b02b17f55b2e789b9747cf4dd2eaaa110439a4cc Mon Sep 17 00:00:00 2001
From: Frieder Schrempf <frieder.schrempf@exceet.de>
Date: Thu, 2 Aug 2018 14:53:54 +0200
Subject: [PATCH] mtd: m25p80: Call spi_mem_get_name() to let controller set a
 custom name

By calling spi_mem_get_name(), the driver of the (Q)SPI controller can
set a custom name for the memory device if necessary.
This is useful to keep mtdparts compatible when controller drivers are
ported from the MTD to the SPI layer.

Suggested-by: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Frieder Schrempf <frieder.schrempf@exceet.de>
Acked-by: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/mtd/devices/m25p80.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index e84563d2067f..aac488008216 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -202,6 +202,9 @@ static int m25p_probe(struct spi_mem *spimem)
 	if (data && data->name)
 		nor->mtd.name = data->name;
 
+	if (!nor->mtd.name)
+		nor->mtd.name = spi_mem_get_name(spimem);
+
 	/* For some (historical?) reason many platforms provide two different
 	 * names in flash_platform_data: "name" and "type". Quite often name is
 	 * set to "m25p80" and then "type" provides a real chip name.
-- 
2.18.0


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

* Applied "spi: spi-mem: Fix a typo in the documentation of struct spi_mem" to the spi tree
  2018-08-02 12:53 ` [PATCH v3 1/3] spi: spi-mem: Fix a typo in the documentation of struct spi_mem Frieder Schrempf
  2018-08-02 13:09   ` Boris Brezillon
@ 2018-08-02 14:58   ` Mark Brown
  1 sibling, 0 replies; 11+ messages in thread
From: Mark Brown @ 2018-08-02 14:58 UTC (permalink / raw)
  To: Frieder Schrempf
  Cc: Boris Brezillon, Mark Brown, dwmw2, computersforpeace,
	boris.brezillon, marek.vasut, richard, broonie, linux-mtd,
	linux-spi, cyrille.pitchen, frieder.schrempf, pp, Zhiqiang.Hou,
	linux-kernel, linux-spi

The patch

   spi: spi-mem: Fix a typo in the documentation of struct spi_mem

has been applied to the spi tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 06bcb5168d7d49aa3ed449ff13a6d13c30afc3f0 Mon Sep 17 00:00:00 2001
From: Frieder Schrempf <frieder.schrempf@exceet.de>
Date: Thu, 2 Aug 2018 14:53:52 +0200
Subject: [PATCH] spi: spi-mem: Fix a typo in the documentation of struct
 spi_mem

Fix a typo in the @drvpriv description.

Signed-off-by: Frieder Schrempf <frieder.schrempf@exceet.de>
Acked-by: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 include/linux/spi/spi-mem.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/spi/spi-mem.h b/include/linux/spi/spi-mem.h
index bb4bd15ae1f6..951a2e949d5f 100644
--- a/include/linux/spi/spi-mem.h
+++ b/include/linux/spi/spi-mem.h
@@ -122,7 +122,7 @@ struct spi_mem_op {
 /**
  * struct spi_mem - describes a SPI memory device
  * @spi: the underlying SPI device
- * @drvpriv: spi_mem_drviver private data
+ * @drvpriv: spi_mem_driver private data
  *
  * Extra information that describe the SPI memory device and may be needed by
  * the controller to properly handle this device should be placed here.
-- 
2.18.0


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

end of thread, other threads:[~2018-08-02 14:58 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-02 12:53 [PATCH v3 0/3] Extend the SPI mem interface to set a custom memory name Frieder Schrempf
2018-08-02 12:53 ` [PATCH v3 1/3] spi: spi-mem: Fix a typo in the documentation of struct spi_mem Frieder Schrempf
2018-08-02 13:09   ` Boris Brezillon
2018-08-02 13:39     ` Frieder Schrempf
2018-08-02 14:35       ` Mark Brown
2018-08-02 14:58   ` Applied "spi: spi-mem: Fix a typo in the documentation of struct spi_mem" to the spi tree Mark Brown
2018-08-02 12:53 ` [PATCH v3 2/3] spi: spi-mem: Extend the SPI mem interface to set a custom memory name Frieder Schrempf
2018-08-02 13:12   ` Boris Brezillon
2018-08-02 12:53 ` [PATCH v3 3/3] mtd: m25p80: Call spi_mem_get_name() to let controller set a custom name Frieder Schrempf
2018-08-02 13:14   ` Boris Brezillon
2018-08-02 14:58   ` Applied "mtd: m25p80: Call spi_mem_get_name() to let controller set a custom name" to the spi tree Mark Brown

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