linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: linux-rtc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
	Alexandre Belloni <alexandre.belloni@bootlin.com>
Subject: [PATCH 3/8] rtc: ds1672: remove sysfs debug interface
Date: Sun,  7 Apr 2019 23:05:36 +0200	[thread overview]
Message-ID: <20190407210541.13409-3-alexandre.belloni@bootlin.com> (raw)
In-Reply-To: <20190407210541.13409-1-alexandre.belloni@bootlin.com>

Remove the control sysfs file as it is not documented, read only and was
only used to provide the oscillator state.

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

diff --git a/drivers/rtc/rtc-ds1672.c b/drivers/rtc/rtc-ds1672.c
index 71645f009e04..4b4757a6644d 100644
--- a/drivers/rtc/rtc-ds1672.c
+++ b/drivers/rtc/rtc-ds1672.c
@@ -114,51 +114,6 @@ static int ds1672_rtc_set_mmss(struct device *dev, unsigned long secs)
 	return ds1672_set_mmss(to_i2c_client(dev), secs);
 }
 
-static int ds1672_get_control(struct i2c_client *client, u8 *status)
-{
-	unsigned char addr = DS1672_REG_CONTROL;
-
-	struct i2c_msg msgs[] = {
-		{/* setup read ptr */
-			.addr = client->addr,
-			.len = 1,
-			.buf = &addr
-		},
-		{/* read control */
-			.addr = client->addr,
-			.flags = I2C_M_RD,
-			.len = 1,
-			.buf = status
-		},
-	};
-
-	/* read control register */
-	if ((i2c_transfer(client->adapter, &msgs[0], 2)) != 2) {
-		dev_err(&client->dev, "%s: read error\n", __func__);
-		return -EIO;
-	}
-
-	return 0;
-}
-
-/* following are the sysfs callback functions */
-static ssize_t show_control(struct device *dev, struct device_attribute *attr,
-			    char *buf)
-{
-	struct i2c_client *client = to_i2c_client(dev);
-	u8 control;
-	int err;
-
-	err = ds1672_get_control(client, &control);
-	if (err)
-		return err;
-
-	return sprintf(buf, "%s\n", (control & DS1672_REG_CONTROL_EOSC)
-		       ? "disabled" : "enabled");
-}
-
-static DEVICE_ATTR(control, S_IRUGO, show_control, NULL);
-
 static const struct rtc_class_ops ds1672_rtc_ops = {
 	.read_time = ds1672_rtc_read_time,
 	.set_mmss = ds1672_rtc_set_mmss,
@@ -191,12 +146,6 @@ static int ds1672_probe(struct i2c_client *client,
 
 	i2c_set_clientdata(client, rtc);
 
-	/* Register sysfs hooks */
-	err = device_create_file(&client->dev, &dev_attr_control);
-	if (err)
-		dev_err(&client->dev, "Unable to create sysfs entry: %s\n",
-			dev_attr_control.attr.name);
-
 	return 0;
 }
 
-- 
2.20.1


  parent reply	other threads:[~2019-04-07 21:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-07 21:05 [PATCH 1/8] rtc: ds1672: set range Alexandre Belloni
2019-04-07 21:05 ` [PATCH 2/8] rtc: ds1672: move oscillator handling to .read_time Alexandre Belloni
2019-04-07 21:05 ` Alexandre Belloni [this message]
2019-04-07 21:05 ` [PATCH 4/8] rtc: ds1672: remove useless indirection Alexandre Belloni
2019-04-07 21:05 ` [PATCH 5/8] rtc: ds1672: use rtc_time64_to_tm Alexandre Belloni
2019-04-07 21:05 ` [PATCH 6/8] rtc: ds1672: use .set_time Alexandre Belloni
2019-04-07 21:05 ` [PATCH 7/8] rtc: ds1672: convert to SPDX identifier Alexandre Belloni
2019-04-07 21:05 ` [PATCH 8/8] rtc: ds1672: switch debug message to %ptR Alexandre Belloni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190407210541.13409-3-alexandre.belloni@bootlin.com \
    --to=alexandre.belloni@bootlin.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).