linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] rtc: pcf85363: remove unused struct pcf85363 member
@ 2019-04-10 20:56 Alexandre Belloni
  2019-04-10 20:56 ` [PATCH 2/5] rtc: pcf85363: set range Alexandre Belloni
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Alexandre Belloni @ 2019-04-10 20:56 UTC (permalink / raw)
  To: linux-rtc; +Cc: linux-kernel, Alexandre Belloni

pcf85363->dev is unused, remove it.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
 drivers/rtc/rtc-pcf85363.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-pcf85363.c b/drivers/rtc/rtc-pcf85363.c
index a3988079f60a..3905c0ad9d83 100644
--- a/drivers/rtc/rtc-pcf85363.c
+++ b/drivers/rtc/rtc-pcf85363.c
@@ -115,7 +115,6 @@
 static struct i2c_driver pcf85363_driver;
 
 struct pcf85363 {
-	struct device		*dev;
 	struct rtc_device	*rtc;
 	struct regmap		*regmap;
 };
@@ -400,10 +399,9 @@ static int pcf85363_probe(struct i2c_client *client,
 		return PTR_ERR(pcf85363->regmap);
 	}
 
-	pcf85363->dev = &client->dev;
 	i2c_set_clientdata(client, pcf85363);
 
-	pcf85363->rtc = devm_rtc_allocate_device(pcf85363->dev);
+	pcf85363->rtc = devm_rtc_allocate_device(&client->dev);
 	if (IS_ERR(pcf85363->rtc))
 		return PTR_ERR(pcf85363->rtc);
 
@@ -413,7 +411,7 @@ static int pcf85363_probe(struct i2c_client *client,
 		regmap_write(pcf85363->regmap, CTRL_FLAGS, 0);
 		regmap_update_bits(pcf85363->regmap, CTRL_PIN_IO,
 				   PIN_IO_INTA_OUT, PIN_IO_INTAPM);
-		ret = devm_request_threaded_irq(pcf85363->dev, client->irq,
+		ret = devm_request_threaded_irq(&client->dev, client->irq,
 						NULL, pcf85363_rtc_handle_irq,
 						IRQF_TRIGGER_LOW | IRQF_ONESHOT,
 						"pcf85363", client);
-- 
2.20.1


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

* [PATCH 2/5] rtc: pcf85363: set range
  2019-04-10 20:56 [PATCH 1/5] rtc: pcf85363: remove unused struct pcf85363 member Alexandre Belloni
@ 2019-04-10 20:56 ` Alexandre Belloni
  2019-04-10 20:56 ` [PATCH 3/5] rtc: pcf85363: remove bogus i2c functionality check Alexandre Belloni
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Alexandre Belloni @ 2019-04-10 20:56 UTC (permalink / raw)
  To: linux-rtc; +Cc: linux-kernel, Alexandre Belloni

This is a standard BCD RTC that will fail in 2100.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
 drivers/rtc/rtc-pcf85363.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/rtc/rtc-pcf85363.c b/drivers/rtc/rtc-pcf85363.c
index 3905c0ad9d83..8d538a253d72 100644
--- a/drivers/rtc/rtc-pcf85363.c
+++ b/drivers/rtc/rtc-pcf85363.c
@@ -406,6 +406,8 @@ static int pcf85363_probe(struct i2c_client *client,
 		return PTR_ERR(pcf85363->rtc);
 
 	pcf85363->rtc->ops = &rtc_ops;
+	pcf85363->rtc->range_min = RTC_TIMESTAMP_BEGIN_2000;
+	pcf85363->rtc->range_max = RTC_TIMESTAMP_END_2099;
 
 	if (client->irq > 0) {
 		regmap_write(pcf85363->regmap, CTRL_FLAGS, 0);
-- 
2.20.1


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

* [PATCH 3/5] rtc: pcf85363: remove bogus i2c functionality check
  2019-04-10 20:56 [PATCH 1/5] rtc: pcf85363: remove unused struct pcf85363 member Alexandre Belloni
  2019-04-10 20:56 ` [PATCH 2/5] rtc: pcf85363: set range Alexandre Belloni
@ 2019-04-10 20:56 ` Alexandre Belloni
  2019-04-10 20:56 ` [PATCH 4/5] rtc: pcf85363: remove useless forward declaration Alexandre Belloni
  2019-04-10 20:56 ` [PATCH 5/5] rtc: pcf85363: convert to SPDX identifier Alexandre Belloni
  3 siblings, 0 replies; 5+ messages in thread
From: Alexandre Belloni @ 2019-04-10 20:56 UTC (permalink / raw)
  To: linux-rtc; +Cc: linux-kernel, Alexandre Belloni

regmap is abstracting the i2c functionalities the best it can, there is no
need to check.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
 drivers/rtc/rtc-pcf85363.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/rtc/rtc-pcf85363.c b/drivers/rtc/rtc-pcf85363.c
index 8d538a253d72..5e369846795e 100644
--- a/drivers/rtc/rtc-pcf85363.c
+++ b/drivers/rtc/rtc-pcf85363.c
@@ -385,9 +385,6 @@ static int pcf85363_probe(struct i2c_client *client,
 	if (data)
 		config = data;
 
-	if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C))
-		return -ENODEV;
-
 	pcf85363 = devm_kzalloc(&client->dev, sizeof(struct pcf85363),
 				GFP_KERNEL);
 	if (!pcf85363)
-- 
2.20.1


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

* [PATCH 4/5] rtc: pcf85363: remove useless forward declaration
  2019-04-10 20:56 [PATCH 1/5] rtc: pcf85363: remove unused struct pcf85363 member Alexandre Belloni
  2019-04-10 20:56 ` [PATCH 2/5] rtc: pcf85363: set range Alexandre Belloni
  2019-04-10 20:56 ` [PATCH 3/5] rtc: pcf85363: remove bogus i2c functionality check Alexandre Belloni
@ 2019-04-10 20:56 ` Alexandre Belloni
  2019-04-10 20:56 ` [PATCH 5/5] rtc: pcf85363: convert to SPDX identifier Alexandre Belloni
  3 siblings, 0 replies; 5+ messages in thread
From: Alexandre Belloni @ 2019-04-10 20:56 UTC (permalink / raw)
  To: linux-rtc; +Cc: linux-kernel, Alexandre Belloni

It is not necessary to forward declare pcf85363_driver as it is not used
before being declared.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
 drivers/rtc/rtc-pcf85363.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/rtc/rtc-pcf85363.c b/drivers/rtc/rtc-pcf85363.c
index 5e369846795e..afb1baacdaa7 100644
--- a/drivers/rtc/rtc-pcf85363.c
+++ b/drivers/rtc/rtc-pcf85363.c
@@ -112,8 +112,6 @@
 
 #define NVRAM_SIZE	0x40
 
-static struct i2c_driver pcf85363_driver;
-
 struct pcf85363 {
 	struct rtc_device	*rtc;
 	struct regmap		*regmap;
-- 
2.20.1


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

* [PATCH 5/5] rtc: pcf85363: convert to SPDX identifier
  2019-04-10 20:56 [PATCH 1/5] rtc: pcf85363: remove unused struct pcf85363 member Alexandre Belloni
                   ` (2 preceding siblings ...)
  2019-04-10 20:56 ` [PATCH 4/5] rtc: pcf85363: remove useless forward declaration Alexandre Belloni
@ 2019-04-10 20:56 ` Alexandre Belloni
  3 siblings, 0 replies; 5+ messages in thread
From: Alexandre Belloni @ 2019-04-10 20:56 UTC (permalink / raw)
  To: linux-rtc; +Cc: linux-kernel, Alexandre Belloni

Use SPDX-License-Identifier instead of a verbose license text.

The original text refers to version 2 so also update MODULE_LICENSE() to
"GPL v2" instead of "GPL".

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
 drivers/rtc/rtc-pcf85363.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/rtc/rtc-pcf85363.c b/drivers/rtc/rtc-pcf85363.c
index afb1baacdaa7..a075e77617dc 100644
--- a/drivers/rtc/rtc-pcf85363.c
+++ b/drivers/rtc/rtc-pcf85363.c
@@ -1,15 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * drivers/rtc/rtc-pcf85363.c
  *
  * Driver for NXP PCF85363 real-time clock.
  *
  * Copyright (C) 2017 Eric Nelson
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Based loosely on rtc-8583 by Russell King, Wolfram Sang and Juergen Beisert
  */
 #include <linux/module.h>
 #include <linux/i2c.h>
-- 
2.20.1


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

end of thread, other threads:[~2019-04-10 20:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-10 20:56 [PATCH 1/5] rtc: pcf85363: remove unused struct pcf85363 member Alexandre Belloni
2019-04-10 20:56 ` [PATCH 2/5] rtc: pcf85363: set range Alexandre Belloni
2019-04-10 20:56 ` [PATCH 3/5] rtc: pcf85363: remove bogus i2c functionality check Alexandre Belloni
2019-04-10 20:56 ` [PATCH 4/5] rtc: pcf85363: remove useless forward declaration Alexandre Belloni
2019-04-10 20:56 ` [PATCH 5/5] rtc: pcf85363: convert to SPDX identifier Alexandre Belloni

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