Skip to contentSkip to conversation

spi: mips-lantiq: Use devm_spi_register_master()

PATCH Applied Jingoo Han 5 participants 11 messages Dec 4, 2013 – Dec 9, 2013 4 messages not in the archive SPI

lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH 1/4 spi: mips-lantiq: Use devm_spi_register_master()

Use devm_spi_register_master() to make cleanup paths simpler, and remove unnecessary remove().

---
 drivers/spi/spi-falcon.c |   12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
drivers/spi/spi-falcon.c +1 -11
index c7a74f0..dd5bd46 100644
@@ -433,21 +433,12 @@ static int falcon_sflash_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, priv);
 
-	ret = spi_register_master(master);
+	ret = devm_spi_register_master(&pdev->dev, master);
 	if (ret)
 		spi_master_put(master);
 	return ret;
 }
 
-static int falcon_sflash_remove(struct platform_device *pdev)
-{
-	struct falcon_sflash *priv = platform_get_drvdata(pdev);
-
-	spi_unregister_master(priv->master);
-
-	return 0;
-}
-
 static const struct of_device_id falcon_sflash_match[] = {
 	{ .compatible = "lantiq,sflash-falcon" },
 	{},
@@ -456,7 +447,6 @@ MODULE_DEVICE_TABLE(of, falcon_sflash_match);
 
 static struct platform_driver falcon_sflash_driver = {
 	.probe	= falcon_sflash_probe,
-	.remove	= falcon_sflash_remove,
 	.driver = {
 		.name	= DRV_NAME,
 		.owner	= THIS_MODULE,
Signature · 7 lines
1.7.10.4


--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
author
#2 lore raw

PATCH 2/4 spi: rcar: Use devm_spi_register_master()

In reply to a message not in the archive

Use devm_spi_register_master() to make cleanup paths simpler.

---
 drivers/spi/spi-rspi.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/spi/spi-rspi.c +1 -2
index 19c65c4..cfdbb42 100644
@@ -887,7 +887,6 @@ static int rspi_remove(struct platform_device *pdev)
 {
 	struct rspi_data *rspi = platform_get_drvdata(pdev);
 
-	spi_unregister_master(rspi->master);
 	rspi_release_dma(rspi);
 
 	return 0;
@@ -972,7 +971,7 @@ static int rspi_probe(struct platform_device *pdev)
 		goto error2;
 	}
 
-	ret = spi_register_master(master);
+	ret = devm_spi_register_master(&pdev->dev, master);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "spi_register_master error.\n");
 		goto error2;
Signature · 7 lines
1.7.10.4


--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
author
#5 lore raw

PATCH 3/4 spi: sc18is602: Use devm_spi_register_master()

In reply to a message not in the archive

Use devm_spi_register_master() to make cleanup paths simpler, and remove unnecessary remove().

---
 drivers/spi/spi-sc18is602.c |   13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)
drivers/spi/spi-sc18is602.c +1 -12
index 9eda21d..c1a01d1 100644
@@ -319,7 +319,7 @@ static int sc18is602_probe(struct i2c_client *client,
 	master->transfer_one_message = sc18is602_transfer_one;
 	master->dev.of_node = np;
 
-	error = spi_register_master(master);
+	error = devm_spi_register_master(dev, master);
 	if (error)
 		goto error_reg;
 
@@ -330,16 +330,6 @@ error_reg:
 	return error;
 }
 
-static int sc18is602_remove(struct i2c_client *client)
-{
-	struct sc18is602 *hw = i2c_get_clientdata(client);
-	struct spi_master *master = hw->master;
-
-	spi_unregister_master(master);
-
-	return 0;
-}
-
 static const struct i2c_device_id sc18is602_id[] = {
 	{ "sc18is602", sc18is602 },
 	{ "sc18is602b", sc18is602b },
@@ -353,7 +343,6 @@ static struct i2c_driver sc18is602_driver = {
 		.name = "sc18is602",
 	},
 	.probe = sc18is602_probe,
-	.remove = sc18is602_remove,
 	.id_table = sc18is602_id,
 };
 
Signature · 7 lines
1.7.10.4


--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
author
#9 lore raw

PATCH 4/4 spi: spi-xcomm: Use devm_spi_register_master()

In reply to a message not in the archive

Use devm_spi_register_master() to make cleanup paths simpler, and remove unnecessary remove().

---
 drivers/spi/spi-xcomm.c |   12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
drivers/spi/spi-xcomm.c +1 -11
index 4258c71..24c40b1 100644
@@ -231,22 +231,13 @@ static int spi_xcomm_probe(struct i2c_client *i2c,
 	master->dev.of_node = i2c->dev.of_node;
 	i2c_set_clientdata(i2c, master);
 
-	ret = spi_register_master(master);
+	ret = devm_spi_register_master(&i2c->dev, master);
 	if (ret < 0)
 		spi_master_put(master);
 
 	return ret;
 }
 
-static int spi_xcomm_remove(struct i2c_client *i2c)
-{
-	struct spi_master *master = i2c_get_clientdata(i2c);
-
-	spi_unregister_master(master);
-
-	return 0;
-}
-
 static const struct i2c_device_id spi_xcomm_ids[] = {
 	{ "spi-xcomm" },
 	{ },
@@ -259,7 +250,6 @@ static struct i2c_driver spi_xcomm_driver = {
 	},
 	.id_table	= spi_xcomm_ids,
 	.probe		= spi_xcomm_probe,
-	.remove		= spi_xcomm_remove,
 };
 module_i2c_driver(spi_xcomm_driver);
 
Signature · 7 lines
1.7.10.4


--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Acked-by
#7 lore raw

Re: [PATCH 3/4] spi: sc18is602: Use devm_spi_register_master()

In reply to a message not in the archive
Quoted 4 lines · Jingoo Han

Use devm_spi_register_master() to make cleanup paths simpler, and remove unnecessary remove().

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#11 lore raw

Re: [PATCH 4/4] spi: spi-xcomm: Use devm_spi_register_master()

In reply to a message not in the archive
Quoted 4 lines · Jingoo Han

Use devm_spi_register_master() to make cleanup paths simpler, and remove unnecessary remove().

Looks good, thanks.

Quoted 34 lines
---
 drivers/spi/spi-xcomm.c |   12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
drivers/spi/spi-xcomm.c +1 -10
index 4258c71..24c40b1 100644
@@ -231,22 +231,13 @@ static int spi_xcomm_probe(struct i2c_client *i2c,
 	master->dev.of_node = i2c->dev.of_node;
 	i2c_set_clientdata(i2c, master);
 
-	ret = spi_register_master(master);
+	ret = devm_spi_register_master(&i2c->dev, master);
 	if (ret < 0)
 		spi_master_put(master);
 
 	return ret;
 }
 
-static int spi_xcomm_remove(struct i2c_client *i2c)
-{
-	struct spi_master *master = i2c_get_clientdata(i2c);
-
-	spi_unregister_master(master);
-
-	return 0;
-}
-
 static const struct i2c_device_id spi_xcomm_ids[] = {
 	{ "spi-xcomm" },
 	{ },

drivers/spi/spi-xcomm.c static struct i2c_driver spi_xcomm_driver = { · line 255

Quoted 7 lines
drivers/spi/spi-xcomm.c +0 -1
@@ -259,7 +250,6 @@ static struct i2c_driver spi_xcomm_driver = {
 	},
 	.id_table	= spi_xcomm_ids,
 	.probe		= spi_xcomm_probe,
-	.remove		= spi_xcomm_remove,
 };
 module_i2c_driver(spi_xcomm_driver);
 

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#13 lore raw
In reply to a message not in the archive

Jingoo Han wrote on 2013-12-04:

Quoted 4 lines

Use devm_spi_register_master() to make cleanup paths simpler, and remove unnecessary remove().

Looks good, thanks.

Quoted 33 lines
---
 drivers/spi/spi-falcon.c |   12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
drivers/spi/spi-falcon.c +1 -10
index c7a74f0..dd5bd46 100644
@@ -433,21 +433,12 @@ static int falcon_sflash_probe(struct
 platform_device *pdev)
 
 	platform_set_drvdata(pdev, priv);
 
-	ret = spi_register_master(master);
+	ret = devm_spi_register_master(&pdev->dev, master);
 	if (ret)
 		spi_master_put(master);
 	return ret;
 }
 
-static int falcon_sflash_remove(struct platform_device *pdev)
-{
-	struct falcon_sflash *priv = platform_get_drvdata(pdev);
-
-	spi_unregister_master(priv->master);
-
-	return 0;
-}
-
 static const struct of_device_id falcon_sflash_match[] = {
 	{ .compatible = "lantiq,sflash-falcon" },
drivers/spi/spi-falcon.c +0 -0
 	{},

drivers/spi/spi-falcon.c MODULE_DEVICE_TABLE(of, falcon_sflash_match); · line 452

Quoted 7 lines
drivers/spi/spi-falcon.c +0 -1
@@ -456,7 +447,6 @@ MODULE_DEVICE_TABLE(of, falcon_sflash_match);
 
 static struct platform_driver falcon_sflash_driver = {
 	.probe	= falcon_sflash_probe,
-	.remove	= falcon_sflash_remove,
 	.driver = {
 		.name	= DRV_NAME,
 		.owner	= THIS_MODULE,

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Applied
#8 lore raw

Re: [PATCH 3/4] spi: sc18is602: Use devm_spi_register_master()

In reply to a message not in the archive
Quoted 2 lines · Jingoo Han

Use devm_spi_register_master() to make cleanup paths simpler, and remove unnecessary remove().

Applied, thanks.