Re: [PATCH] spi: mediatek: Use of_device_get_match_data()

2018-05-01 Thread Mark Brown
On Mon, Apr 30, 2018 at 03:26:36PM +0800, Ryder Lee wrote:
> Hi Mark,
> 
> Is it okay with you?
> 
> On Mon, 2018-04-16 at 10:33 +0800, Ryder Lee (李庚?V) wrote:
> > The usage of of_device_get_match_data() reduce the code size a bit.

Please don't send content free pings and please allow a reasonable time
for review.  People get busy, go on holiday, attend conferences and so 
on so unless there is some reason for urgency (like critical bug fixes)
please allow at least a couple of weeks for review.  If there have been
review comments then people may be waiting for those to be addressed.
Sending content free pings just adds to the mail volume (if they are
seen at all) and if something has gone wrong you'll have to resend the
patches anyway.


signature.asc
Description: PGP signature


Re: [PATCH] spi: mediatek: Use of_device_get_match_data()

2018-05-01 Thread Mark Brown
On Mon, Apr 30, 2018 at 03:26:36PM +0800, Ryder Lee wrote:
> Hi Mark,
> 
> Is it okay with you?
> 
> On Mon, 2018-04-16 at 10:33 +0800, Ryder Lee (李庚?V) wrote:
> > The usage of of_device_get_match_data() reduce the code size a bit.

Please don't send content free pings and please allow a reasonable time
for review.  People get busy, go on holiday, attend conferences and so 
on so unless there is some reason for urgency (like critical bug fixes)
please allow at least a couple of weeks for review.  If there have been
review comments then people may be waiting for those to be addressed.
Sending content free pings just adds to the mail volume (if they are
seen at all) and if something has gone wrong you'll have to resend the
patches anyway.


signature.asc
Description: PGP signature


Re: [PATCH] spi: mediatek: Use of_device_get_match_data()

2018-04-30 Thread Ryder Lee
Hi Mark,

Is it okay with you?

On Mon, 2018-04-16 at 10:33 +0800, Ryder Lee (李庚?V) wrote:
> The usage of of_device_get_match_data() reduce the code size a bit.
> 
> Also, the only way to call mtk_spi_probe() is to match an entry in
> mtk_spi_of_match[], so of_id cannot be NULL.
> 
> Signed-off-by: Ryder Lee 
> ---
>  drivers/spi/spi-mt65xx.c | 12 +++-
>  1 file changed, 3 insertions(+), 9 deletions(-)
> 





Re: [PATCH] spi: mediatek: Use of_device_get_match_data()

2018-04-30 Thread Ryder Lee
Hi Mark,

Is it okay with you?

On Mon, 2018-04-16 at 10:33 +0800, Ryder Lee (李庚?V) wrote:
> The usage of of_device_get_match_data() reduce the code size a bit.
> 
> Also, the only way to call mtk_spi_probe() is to match an entry in
> mtk_spi_of_match[], so of_id cannot be NULL.
> 
> Signed-off-by: Ryder Lee 
> ---
>  drivers/spi/spi-mt65xx.c | 12 +++-
>  1 file changed, 3 insertions(+), 9 deletions(-)
> 





[PATCH] spi: mediatek: Use of_device_get_match_data()

2018-04-15 Thread Ryder Lee
The usage of of_device_get_match_data() reduce the code size a bit.

Also, the only way to call mtk_spi_probe() is to match an entry in
mtk_spi_of_match[], so of_id cannot be NULL.

Signed-off-by: Ryder Lee 
---
 drivers/spi/spi-mt65xx.c | 12 +++-
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi-mt65xx.c
index 86bf456..3edc183 100644
--- a/drivers/spi/spi-mt65xx.c
+++ b/drivers/spi/spi-mt65xx.c
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -578,7 +579,6 @@ static int mtk_spi_probe(struct platform_device *pdev)
 {
struct spi_master *master;
struct mtk_spi *mdata;
-   const struct of_device_id *of_id;
struct resource *res;
int i, irq, ret;
 
@@ -598,15 +598,9 @@ static int mtk_spi_probe(struct platform_device *pdev)
master->can_dma = mtk_spi_can_dma;
master->setup = mtk_spi_setup;
 
-   of_id = of_match_node(mtk_spi_of_match, pdev->dev.of_node);
-   if (!of_id) {
-   dev_err(>dev, "failed to probe of_node\n");
-   ret = -EINVAL;
-   goto err_put_master;
-   }
-
mdata = spi_master_get_devdata(master);
-   mdata->dev_comp = of_id->data;
+   mdata->dev_comp = of_device_get_match_data(>dev);
+
if (mdata->dev_comp->must_tx)
master->flags = SPI_MASTER_MUST_TX;
 
-- 
1.9.1



[PATCH] spi: mediatek: Use of_device_get_match_data()

2018-04-15 Thread Ryder Lee
The usage of of_device_get_match_data() reduce the code size a bit.

Also, the only way to call mtk_spi_probe() is to match an entry in
mtk_spi_of_match[], so of_id cannot be NULL.

Signed-off-by: Ryder Lee 
---
 drivers/spi/spi-mt65xx.c | 12 +++-
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi-mt65xx.c
index 86bf456..3edc183 100644
--- a/drivers/spi/spi-mt65xx.c
+++ b/drivers/spi/spi-mt65xx.c
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -578,7 +579,6 @@ static int mtk_spi_probe(struct platform_device *pdev)
 {
struct spi_master *master;
struct mtk_spi *mdata;
-   const struct of_device_id *of_id;
struct resource *res;
int i, irq, ret;
 
@@ -598,15 +598,9 @@ static int mtk_spi_probe(struct platform_device *pdev)
master->can_dma = mtk_spi_can_dma;
master->setup = mtk_spi_setup;
 
-   of_id = of_match_node(mtk_spi_of_match, pdev->dev.of_node);
-   if (!of_id) {
-   dev_err(>dev, "failed to probe of_node\n");
-   ret = -EINVAL;
-   goto err_put_master;
-   }
-
mdata = spi_master_get_devdata(master);
-   mdata->dev_comp = of_id->data;
+   mdata->dev_comp = of_device_get_match_data(>dev);
+
if (mdata->dev_comp->must_tx)
master->flags = SPI_MASTER_MUST_TX;
 
-- 
1.9.1