2015-07-10 06:36:32

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH] Drop owner assignment from i2c_driver (and platform left-overs)

Hi,


The i2c drivers also do not have to set 'owner' field because
i2c_register_driver() will do it instead.

'owner' is removed from i2c drivers, which I was able to compile
with allyesconfig (arm, arm64, i386, x86_64, ppc64).
Only compile-tested.

The coccinelle script which generated the patch was sent here:
http://www.spinics.net/lists/kernel/msg2029903.html


Best regards,
Krzysztof


Krzysztof Kozlowski (2):
tty: serial: Drop owner assignment from platform_driver
tty: serial: Drop owner assignment from i2c_driver

drivers/tty/serial/8250/8250_ingenic.c | 1 -
drivers/tty/serial/sc16is7xx.c | 1 -
2 files changed, 2 deletions(-)

--
1.9.1


2015-07-10 06:36:49

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 1/2] tty: serial: Drop owner assignment from platform_driver

platform_driver does not need to set an owner because
platform_driver_register() will set it.

Signed-off-by: Krzysztof Kozlowski <[email protected]>

---

The coccinelle script which generated the patch was sent here:
http://www.spinics.net/lists/kernel/msg2029903.html
---
drivers/tty/serial/8250/8250_ingenic.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/tty/serial/8250/8250_ingenic.c b/drivers/tty/serial/8250/8250_ingenic.c
index 21bf81fe794f..7c1e4be48e7b 100644
--- a/drivers/tty/serial/8250/8250_ingenic.c
+++ b/drivers/tty/serial/8250/8250_ingenic.c
@@ -252,7 +252,6 @@ MODULE_DEVICE_TABLE(of, of_match);
static struct platform_driver ingenic_uart_platform_driver = {
.driver = {
.name = "ingenic-uart",
- .owner = THIS_MODULE,
.of_match_table = of_match,
},
.probe = ingenic_uart_probe,
--
1.9.1

2015-07-10 06:36:45

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 2/2] tty: serial: Drop owner assignment from i2c_driver

i2c_driver does not need to set an owner because i2c_register_driver()
will set it.

Signed-off-by: Krzysztof Kozlowski <[email protected]>

---

The coccinelle script which generated the patch was sent here:
http://www.spinics.net/lists/kernel/msg2029903.html
---
drivers/tty/serial/sc16is7xx.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
index 9e6576004a42..bbeb33561737 100644
--- a/drivers/tty/serial/sc16is7xx.c
+++ b/drivers/tty/serial/sc16is7xx.c
@@ -1369,7 +1369,6 @@ MODULE_DEVICE_TABLE(i2c, sc16is7xx_i2c_id_table);
static struct i2c_driver sc16is7xx_i2c_uart_driver = {
.driver = {
.name = SC16IS7XX_NAME,
- .owner = THIS_MODULE,
.of_match_table = of_match_ptr(sc16is7xx_dt_ids),
},
.probe = sc16is7xx_i2c_probe,
--
1.9.1

Subject: RE: [PATCH 2/2] tty: serial: Drop owner assignment from i2c_driver

<br><br>&gt; From: [email protected]<br>&gt; To: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]<br>&gt; Subject: [PATCH 2/2] tty: serial: Drop owner assignment from i2c_driver<br>&gt; Date: Fri, 10 Jul 2015 15:36:20 +0900<br>&gt; <br>&gt; i2c_driver does not need to set an owner because i2c_register_driver()<br>&gt; will set it.<br>&gt; <br>&gt; Signed-off-by: Krzysztof Kozlowski &lt;[email protected]&gt;<br>&gt; <br>&gt; ---<br>&gt; <br>&gt; The coccinelle script which generated the patch was sent here:<br>&gt; http://www.spinics.net/lists/kernel/msg2029903.html<br>&gt; ---<br>&gt; drivers/tty/serial/sc16is7xx.c | 1 -<br>&gt; 1 file changed, 1 deletion(-)<br>&gt; <br>&gt; diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c<br>&gt; index 9e6576004a42..bbeb33561737 100644<br>&gt; --- a/drivers/tty/serial/sc16is7xx.c<br>&gt; +++ b/drivers/tty/serial/sc16is7xx.c<br>&gt; @@ -1369,7 +1369,6 @@ MODULE_DEVICE_TABLE(i2c, sc16is7xx_i2c_id_table);<br>&gt; static struct i2c_driver sc16is7xx_i2c_uart_driver = {<br>&gt; .driver = {<br>&gt; .name = SC16IS7XX_NAME,<br>&gt; - .owner = THIS_MODULE,<br><br>Okay, is there an issue by doing this. Or its just a over doing things ?<br><br>&gt; .of_match_table = of_match_ptr(sc16is7xx_dt_ids),<br>&gt; },<br>&gt; .probe = sc16is7xx_i2c_probe,<br>&gt; -- <br>&gt; 1.9.1<br>&gt; <br>&gt; --<br>&gt; To unsubscribe from this list: send the line "unsubscribe linux-serial" in<br>&gt; the body of a message to [email protected]<br>&gt; More majordomo info at http://vger.kernel.org/majordomo-info.html<br> -