diff mbox series

bus: ts-nbus: remove bus driver without user

Message ID 20190107194523.2772-1-u.kleine-koenig@pengutronix.de
State New
Headers show
Series bus: ts-nbus: remove bus driver without user | expand

Commit Message

Uwe Kleine-König Jan. 7, 2019, 7:45 p.m. UTC
Since the ts-nbus driver was introduced in 2017 it only saw some reworking
changes. There is no user in the tree, neither a machine that has this
bus nor a driver for a device on that bus. Also the email address of the
author doesn't exist any more.

So remove this bus.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
Hello,

I'm not sure where to send this patch to. There was a patch set on the
arm-kernel list but I didn't find the final version in my archive. Arnd
applied the patch (5b143d2a6ede ("bus: add driver for the Technologic
Systems NBUS")) so I send it to him :-)

Best regards
Uwe

 .../devicetree/bindings/bus/ts-nbus.txt       |  50 ---
 drivers/bus/Kconfig                           |   8 -
 drivers/bus/Makefile                          |   1 -
 drivers/bus/ts-nbus.c                         | 369 ------------------
 include/linux/ts-nbus.h                       |  18 -
 5 files changed, 446 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/bus/ts-nbus.txt
 delete mode 100644 drivers/bus/ts-nbus.c
 delete mode 100644 include/linux/ts-nbus.h

Comments

Linus Walleij Jan. 11, 2019, 12:52 p.m. UTC | #1
On Mon, Jan 7, 2019 at 8:46 PM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:

> Since the ts-nbus driver was introduced in 2017 it only saw some reworking
> changes. There is no user in the tree, neither a machine that has this
> bus nor a driver for a device on that bus. Also the email address of the
> author doesn't exist any more.
>
> So remove this bus.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Sebastien added this bus and I was under the impression that he was
using it, even if no config or DTS in the kernel seems to be using it.

IIRC it should land in this one:
arch/arm/boot/dts/imx28-ts4600.dts

This was added over a year ago and not much happened since.

Sebastien what happened with this?
(I hope his mail is not bouncing...)

This interestingly brings up the following question: we used to just
grep the kernel for users of a certain driver, which will find e.g. board
files even if there is currently no defconfig for the system.
With device tree drivers these DTS files defining the use of the
driver can be out-of-tree, sometimes (SunOS?) in the ROM of a
machine, and not possible to check using grep.

We need some policy there, like preferably merge device trees
upstream and add defconfigs so we have some indication that
the driver is used and also get compiled in tests.

Yours,
Linus Walleij
Uwe Kleine-König Jan. 11, 2019, 3:04 p.m. UTC | #2
Hello,

On Fri, Jan 11, 2019 at 01:52:36PM +0100, Linus Walleij wrote:
> On Mon, Jan 7, 2019 at 8:46 PM Uwe Kleine-König
> <u.kleine-koenig@pengutronix.de> wrote:
> 
> > Since the ts-nbus driver was introduced in 2017 it only saw some reworking
> > changes. There is no user in the tree, neither a machine that has this
> > bus nor a driver for a device on that bus. Also the email address of the
> > author doesn't exist any more.
> >
> > So remove this bus.
> >
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> 
> Sebastien added this bus and I was under the impression that he was
> using it, even if no config or DTS in the kernel seems to be using it.
> 
> IIRC it should land in this one:
> arch/arm/boot/dts/imx28-ts4600.dts
> 
> This was added over a year ago and not much happened since.
> 
> Sebastien what happened with this?
> (I hope his mail is not bouncing...)
> 
> This interestingly brings up the following question: we used to just
> grep the kernel for users of a certain driver, which will find e.g. board
> files even if there is currently no defconfig for the system.
> With device tree drivers these DTS files defining the use of the
> driver can be out-of-tree, sometimes (SunOS?) in the ROM of a
> machine, and not possible to check using grep.
> 
> We need some policy there, like preferably merge device trees
> upstream and add defconfigs so we have some indication that
> the driver is used and also get compiled in tests.

Ack. For now I'd say a statement from someone who uses this stuff about
this fact would be good enough. Given that some time ago I sent patches
for this driver and didn't get any feedback from an interested party[1]
I tried with that patch adding some more people from
savoirfairelinux.com ...

I suggest to give them some more time, and then drop this for 5.2 or so
if we don't hear anything.

Best regards
Uwe


[1] https://patchwork.kernel.org/patch/10657725/
Linus Walleij Jan. 11, 2019, 7:56 p.m. UTC | #3
On Fri, Jan 11, 2019 at 4:04 PM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:

> Ack. For now I'd say a statement from someone who uses this stuff about
> this fact would be good enough. Given that some time ago I sent patches
> for this driver and didn't get any feedback from an interested party[1]
> I tried with that patch adding some more people from
> savoirfairelinux.com ...

I forwarded the conversation to Jerome Oufella at savoirfairelinux,
let's see what he says.

Yours,
Linus Walleij
Uwe Kleine-König Dec. 10, 2019, 5:15 p.m. UTC | #4
On Fri, Jan 11, 2019 at 08:56:49PM +0100, Linus Walleij wrote:
> On Fri, Jan 11, 2019 at 4:04 PM Uwe Kleine-König
> <u.kleine-koenig@pengutronix.de> wrote:
> 
> > Ack. For now I'd say a statement from someone who uses this stuff about
> > this fact would be good enough. Given that some time ago I sent patches
> > for this driver and didn't get any feedback from an interested party[1]
> > I tried with that patch adding some more people from
> > savoirfairelinux.com ...
> 
> I forwarded the conversation to Jerome Oufella at savoirfairelinux,
> let's see what he says.

He doesn't seem to say something. Is this the permission to shoot
ts-nbus?

Best regards
Uwe
Linus Walleij Dec. 10, 2019, 9:19 p.m. UTC | #5
On Tue, Dec 10, 2019 at 6:15 PM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
> On Fri, Jan 11, 2019 at 08:56:49PM +0100, Linus Walleij wrote:
> > On Fri, Jan 11, 2019 at 4:04 PM Uwe Kleine-König
> > <u.kleine-koenig@pengutronix.de> wrote:
> >
> > > Ack. For now I'd say a statement from someone who uses this stuff about
> > > this fact would be good enough. Given that some time ago I sent patches
> > > for this driver and didn't get any feedback from an interested party[1]
> > > I tried with that patch adding some more people from
> > > savoirfairelinux.com ...
> >
> > I forwarded the conversation to Jerome Oufella at savoirfairelinux,
> > let's see what he says.
>
> He doesn't seem to say something. Is this the permission to shoot
> ts-nbus?

My point of view is inclusionist, i.e. I only delete code if it is causing
problems for others, such as when we deleted Blackfin because it was
a mess to refactor general drivers since the blackfin boardfiles
were all over the place, or when I deleted the FMC subsystem
because it has its own GPIO implementation and noone was really
willing to help test patches or improve on it.

So I would rather ask: who is hurt by it being around?

Just my €0.01

Yours,
Linus Walleij
Uwe Kleine-König Dec. 10, 2019, 9:27 p.m. UTC | #6
Hello Linus,

On Tue, Dec 10, 2019 at 10:19:55PM +0100, Linus Walleij wrote:
> On Tue, Dec 10, 2019 at 6:15 PM Uwe Kleine-König
> <u.kleine-koenig@pengutronix.de> wrote:
> > On Fri, Jan 11, 2019 at 08:56:49PM +0100, Linus Walleij wrote:
> > > On Fri, Jan 11, 2019 at 4:04 PM Uwe Kleine-König
> > > <u.kleine-koenig@pengutronix.de> wrote:
> > >
> > > > Ack. For now I'd say a statement from someone who uses this stuff about
> > > > this fact would be good enough. Given that some time ago I sent patches
> > > > for this driver and didn't get any feedback from an interested party[1]
> > > > I tried with that patch adding some more people from
> > > > savoirfairelinux.com ...
> > >
> > > I forwarded the conversation to Jerome Oufella at savoirfairelinux,
> > > let's see what he says.
> >
> > He doesn't seem to say something. Is this the permission to shoot
> > ts-nbus?
> 
> My point of view is inclusionist, i.e. I only delete code if it is causing
> problems for others, such as when we deleted Blackfin because it was
> a mess to refactor general drivers since the blackfin boardfiles
> were all over the place, or when I deleted the FMC subsystem
> because it has its own GPIO implementation and noone was really
> willing to help test patches or improve on it.
> 
> So I would rather ask: who is hurt by it being around?

It's one of the legacy PWM API users, and when I worked at improving
it Thierry wondered if it's worth keeping the driver given it has no
users[1].

I don't care much either way, but if we keep the driver "looks dead"
shouldn't be an excuse to not take cleanup patches.

Best regards
Uwe

[1] https://patchwork.kernel.org/patch/10657725/
Linus Walleij Dec. 10, 2019, 11:08 p.m. UTC | #7
On Tue, Dec 10, 2019 at 10:28 PM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
> On Tue, Dec 10, 2019 at 10:19:55PM +0100, Linus Walleij wrote:

> > So I would rather ask: who is hurt by it being around?
>
> It's one of the legacy PWM API users, and when I worked at improving
> it Thierry wondered if it's worth keeping the driver given it has no
> users[1].
>
> I don't care much either way, but if we keep the driver "looks dead"
> shouldn't be an excuse to not take cleanup patches.

Hm are cleanup patches not getting applied?
Isn't the real problem (my halfguess) that drivers/bus/* is a bit
orphaned?

Whenever I want to change something there I just send the patches
to the [ARM] SoC maintainers and ask them to apply it.
arm@kernel.org soc@kernel.org

If it means that you'd have to do tons of cleanups for nonexisting
or ungrateful users I'd say send a patch to delete it.

Yours,
Linus Walleij
Uwe Kleine-König Dec. 11, 2019, 7:11 a.m. UTC | #8
Hello Linus,

On Wed, Dec 11, 2019 at 12:08:14AM +0100, Linus Walleij wrote:
> On Tue, Dec 10, 2019 at 10:28 PM Uwe Kleine-König
> <u.kleine-koenig@pengutronix.de> wrote:
> > On Tue, Dec 10, 2019 at 10:19:55PM +0100, Linus Walleij wrote:
> 
> > > So I would rather ask: who is hurt by it being around?
> >
> > It's one of the legacy PWM API users, and when I worked at improving
> > it Thierry wondered if it's worth keeping the driver given it has no
> > users[1].
> >
> > I don't care much either way, but if we keep the driver "looks dead"
> > shouldn't be an excuse to not take cleanup patches.
> 
> Hm are cleanup patches not getting applied?
> Isn't the real problem (my halfguess) that drivers/bus/* is a bit
> orphaned?
> 
> Whenever I want to change something there I just send the patches
> to the [ARM] SoC maintainers and ask them to apply it.
> arm@kernel.org soc@kernel.org
> 
> If it means that you'd have to do tons of cleanups for nonexisting
> or ungrateful users I'd say send a patch to delete it.

OK, I will readd that driver to my (already long) todo list and send
patches to them when I come around to work in that area again.

Best regards
Uwe
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/bus/ts-nbus.txt b/Documentation/devicetree/bindings/bus/ts-nbus.txt
deleted file mode 100644
index 2a10d065b9fa..000000000000
--- a/Documentation/devicetree/bindings/bus/ts-nbus.txt
+++ /dev/null
@@ -1,50 +0,0 @@ 
-Technologic Systems NBUS
-
-The NBUS is a bus used to interface with peripherals in the Technologic
-Systems FPGA on the TS-4600 SoM.
-
-Required properties :
- - compatible		: "technologic,ts-nbus"
- - #address-cells	: must be 1
- - #size-cells		: must be 0
- - pwms			: The PWM bound to the FPGA
- - ts,data-gpios	: The 8 GPIO pins connected to the data lines on the FPGA
- - ts,csn-gpios		: The GPIO pin connected to the csn line on the FPGA
- - ts,txrx-gpios	: The GPIO pin connected to the txrx line on the FPGA
- - ts,strobe-gpios	: The GPIO pin connected to the stobe line on the FPGA
- - ts,ale-gpios		: The GPIO pin connected to the ale line on the FPGA
- - ts,rdy-gpios		: The GPIO pin connected to the rdy line on the FPGA
-
-Child nodes:
-
-The NBUS node can contain zero or more child nodes representing peripherals
-on the bus.
-
-Example:
-
-	nbus {
-		compatible = "technologic,ts-nbus";
-		pinctrl-0 = <&nbus_pins>;
-		#address-cells = <1>;
-		#size-cells = <0>;
-		pwms = <&pwm 2 83>;
-		ts,data-gpios   = <&gpio0 0 GPIO_ACTIVE_HIGH
-				   &gpio0 1 GPIO_ACTIVE_HIGH
-				   &gpio0 2 GPIO_ACTIVE_HIGH
-				   &gpio0 3 GPIO_ACTIVE_HIGH
-				   &gpio0 4 GPIO_ACTIVE_HIGH
-				   &gpio0 5 GPIO_ACTIVE_HIGH
-				   &gpio0 6 GPIO_ACTIVE_HIGH
-				   &gpio0 7 GPIO_ACTIVE_HIGH>;
-		ts,csn-gpios    = <&gpio0 16 GPIO_ACTIVE_HIGH>;
-		ts,txrx-gpios   = <&gpio0 24 GPIO_ACTIVE_HIGH>;
-		ts,strobe-gpios = <&gpio0 25 GPIO_ACTIVE_HIGH>;
-		ts,ale-gpios    = <&gpio0 26 GPIO_ACTIVE_HIGH>;
-		ts,rdy-gpios    = <&gpio0 21 GPIO_ACTIVE_HIGH>;
-
-		watchdog@2a {
-			compatible = "...";
-
-			/* ... */
-		};
-	};
diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig
index 1851112ccc29..275402198537 100644
--- a/drivers/bus/Kconfig
+++ b/drivers/bus/Kconfig
@@ -147,14 +147,6 @@  config TI_SYSC
 	  Generic driver for Texas Instruments interconnect target module
 	  found on many TI SoCs.
 
-config TS_NBUS
-	tristate "Technologic Systems NBUS Driver"
-	depends on SOC_IMX28
-	depends on OF_GPIO && PWM
-	help
-	  Driver for the Technologic Systems NBUS which is used to interface
-	  with the peripherals in the FPGA of the TS-4600 SoM.
-
 config UNIPHIER_SYSTEM_BUS
 	tristate "UniPhier System Bus driver"
 	depends on ARCH_UNIPHIER && OF
diff --git a/drivers/bus/Makefile b/drivers/bus/Makefile
index ca300b1914ce..1cb001b6fc4f 100644
--- a/drivers/bus/Makefile
+++ b/drivers/bus/Makefile
@@ -27,7 +27,6 @@  obj-$(CONFIG_SIMPLE_PM_BUS)	+= simple-pm-bus.o
 obj-$(CONFIG_TEGRA_ACONNECT)	+= tegra-aconnect.o
 obj-$(CONFIG_TEGRA_GMI)		+= tegra-gmi.o
 obj-$(CONFIG_TI_SYSC)		+= ti-sysc.o
-obj-$(CONFIG_TS_NBUS)		+= ts-nbus.o
 obj-$(CONFIG_UNIPHIER_SYSTEM_BUS)	+= uniphier-system-bus.o
 obj-$(CONFIG_VEXPRESS_CONFIG)	+= vexpress-config.o
 
diff --git a/drivers/bus/ts-nbus.c b/drivers/bus/ts-nbus.c
deleted file mode 100644
index 9989ce904a37..000000000000
--- a/drivers/bus/ts-nbus.c
+++ /dev/null
@@ -1,369 +0,0 @@ 
-/*
- * NBUS driver for TS-4600 based boards
- *
- * Copyright (c) 2016 - Savoir-faire Linux
- * Author: Sebastien Bourdelin <sebastien.bourdelin@savoirfairelinux.com>
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- *
- * This driver implements a GPIOs bit-banged bus, called the NBUS by Technologic
- * Systems. It is used to communicate with the peripherals in the FPGA on the
- * TS-4600 SoM.
- */
-
-#include <linux/bitops.h>
-#include <linux/gpio/consumer.h>
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/mutex.h>
-#include <linux/of_platform.h>
-#include <linux/platform_device.h>
-#include <linux/pwm.h>
-#include <linux/ts-nbus.h>
-
-#define TS_NBUS_DIRECTION_IN  0
-#define TS_NBUS_DIRECTION_OUT 1
-#define TS_NBUS_WRITE_ADR 0
-#define TS_NBUS_WRITE_VAL 1
-
-struct ts_nbus {
-	struct pwm_device *pwm;
-	struct gpio_descs *data;
-	struct gpio_desc *csn;
-	struct gpio_desc *txrx;
-	struct gpio_desc *strobe;
-	struct gpio_desc *ale;
-	struct gpio_desc *rdy;
-	struct mutex lock;
-};
-
-/*
- * request all gpios required by the bus.
- */
-static int ts_nbus_init_pdata(struct platform_device *pdev, struct ts_nbus
-		*ts_nbus)
-{
-	ts_nbus->data = devm_gpiod_get_array(&pdev->dev, "ts,data",
-			GPIOD_OUT_HIGH);
-	if (IS_ERR(ts_nbus->data)) {
-		dev_err(&pdev->dev, "failed to retrieve ts,data-gpio from dts\n");
-		return PTR_ERR(ts_nbus->data);
-	}
-
-	ts_nbus->csn = devm_gpiod_get(&pdev->dev, "ts,csn", GPIOD_OUT_HIGH);
-	if (IS_ERR(ts_nbus->csn)) {
-		dev_err(&pdev->dev, "failed to retrieve ts,csn-gpio from dts\n");
-		return PTR_ERR(ts_nbus->csn);
-	}
-
-	ts_nbus->txrx = devm_gpiod_get(&pdev->dev, "ts,txrx", GPIOD_OUT_HIGH);
-	if (IS_ERR(ts_nbus->txrx)) {
-		dev_err(&pdev->dev, "failed to retrieve ts,txrx-gpio from dts\n");
-		return PTR_ERR(ts_nbus->txrx);
-	}
-
-	ts_nbus->strobe = devm_gpiod_get(&pdev->dev, "ts,strobe", GPIOD_OUT_HIGH);
-	if (IS_ERR(ts_nbus->strobe)) {
-		dev_err(&pdev->dev, "failed to retrieve ts,strobe-gpio from dts\n");
-		return PTR_ERR(ts_nbus->strobe);
-	}
-
-	ts_nbus->ale = devm_gpiod_get(&pdev->dev, "ts,ale", GPIOD_OUT_HIGH);
-	if (IS_ERR(ts_nbus->ale)) {
-		dev_err(&pdev->dev, "failed to retrieve ts,ale-gpio from dts\n");
-		return PTR_ERR(ts_nbus->ale);
-	}
-
-	ts_nbus->rdy = devm_gpiod_get(&pdev->dev, "ts,rdy", GPIOD_IN);
-	if (IS_ERR(ts_nbus->rdy)) {
-		dev_err(&pdev->dev, "failed to retrieve ts,rdy-gpio from dts\n");
-		return PTR_ERR(ts_nbus->rdy);
-	}
-
-	return 0;
-}
-
-/*
- * the data gpios are used for reading and writing values, their directions
- * should be adjusted accordingly.
- */
-static void ts_nbus_set_direction(struct ts_nbus *ts_nbus, int direction)
-{
-	int i;
-
-	for (i = 0; i < 8; i++) {
-		if (direction == TS_NBUS_DIRECTION_IN)
-			gpiod_direction_input(ts_nbus->data->desc[i]);
-		else
-			/* when used as output the default state of the data
-			 * lines are set to high */
-			gpiod_direction_output(ts_nbus->data->desc[i], 1);
-	}
-}
-
-/*
- * reset the bus in its initial state.
- * The data, csn, strobe and ale lines must be zero'ed to let the FPGA knows a
- * new transaction can be process.
- */
-static void ts_nbus_reset_bus(struct ts_nbus *ts_nbus)
-{
-	DECLARE_BITMAP(values, 8);
-
-	values[0] = 0;
-
-	gpiod_set_array_value_cansleep(8, ts_nbus->data->desc,
-				       ts_nbus->data->info, values);
-	gpiod_set_value_cansleep(ts_nbus->csn, 0);
-	gpiod_set_value_cansleep(ts_nbus->strobe, 0);
-	gpiod_set_value_cansleep(ts_nbus->ale, 0);
-}
-
-/*
- * let the FPGA knows it can process.
- */
-static void ts_nbus_start_transaction(struct ts_nbus *ts_nbus)
-{
-	gpiod_set_value_cansleep(ts_nbus->strobe, 1);
-}
-
-/*
- * read a byte value from the data gpios.
- * return 0 on success or negative errno on failure.
- */
-static int ts_nbus_read_byte(struct ts_nbus *ts_nbus, u8 *val)
-{
-	struct gpio_descs *gpios = ts_nbus->data;
-	int ret, i;
-
-	*val = 0;
-	for (i = 0; i < 8; i++) {
-		ret = gpiod_get_value_cansleep(gpios->desc[i]);
-		if (ret < 0)
-			return ret;
-		if (ret)
-			*val |= BIT(i);
-	}
-
-	return 0;
-}
-
-/*
- * set the data gpios accordingly to the byte value.
- */
-static void ts_nbus_write_byte(struct ts_nbus *ts_nbus, u8 byte)
-{
-	struct gpio_descs *gpios = ts_nbus->data;
-	DECLARE_BITMAP(values, 8);
-
-	values[0] = byte;
-
-	gpiod_set_array_value_cansleep(8, gpios->desc, gpios->info, values);
-}
-
-/*
- * reading the bus consists of resetting the bus, then notifying the FPGA to
- * send the data in the data gpios and return the read value.
- * return 0 on success or negative errno on failure.
- */
-static int ts_nbus_read_bus(struct ts_nbus *ts_nbus, u8 *val)
-{
-	ts_nbus_reset_bus(ts_nbus);
-	ts_nbus_start_transaction(ts_nbus);
-
-	return ts_nbus_read_byte(ts_nbus, val);
-}
-
-/*
- * writing to the bus consists of resetting the bus, then define the type of
- * command (address/value), write the data and notify the FPGA to retrieve the
- * value in the data gpios.
- */
-static void ts_nbus_write_bus(struct ts_nbus *ts_nbus, int cmd, u8 val)
-{
-	ts_nbus_reset_bus(ts_nbus);
-
-	if (cmd == TS_NBUS_WRITE_ADR)
-		gpiod_set_value_cansleep(ts_nbus->ale, 1);
-
-	ts_nbus_write_byte(ts_nbus, val);
-	ts_nbus_start_transaction(ts_nbus);
-}
-
-/*
- * read the value in the FPGA register at the given address.
- * return 0 on success or negative errno on failure.
- */
-int ts_nbus_read(struct ts_nbus *ts_nbus, u8 adr, u16 *val)
-{
-	int ret, i;
-	u8 byte;
-
-	/* bus access must be atomic */
-	mutex_lock(&ts_nbus->lock);
-
-	/* set the bus in read mode */
-	gpiod_set_value_cansleep(ts_nbus->txrx, 0);
-
-	/* write address */
-	ts_nbus_write_bus(ts_nbus, TS_NBUS_WRITE_ADR, adr);
-
-	/* set the data gpios direction as input before reading */
-	ts_nbus_set_direction(ts_nbus, TS_NBUS_DIRECTION_IN);
-
-	/* reading value MSB first */
-	do {
-		*val = 0;
-		byte = 0;
-		for (i = 1; i >= 0; i--) {
-			/* read a byte from the bus, leave on error */
-			ret = ts_nbus_read_bus(ts_nbus, &byte);
-			if (ret < 0)
-				goto err;
-
-			/* append the byte read to the final value */
-			*val |= byte << (i * 8);
-		}
-		gpiod_set_value_cansleep(ts_nbus->csn, 1);
-		ret = gpiod_get_value_cansleep(ts_nbus->rdy);
-	} while (ret);
-
-err:
-	/* restore the data gpios direction as output after reading */
-	ts_nbus_set_direction(ts_nbus, TS_NBUS_DIRECTION_OUT);
-
-	mutex_unlock(&ts_nbus->lock);
-
-	return ret;
-}
-EXPORT_SYMBOL_GPL(ts_nbus_read);
-
-/*
- * write the desired value in the FPGA register at the given address.
- */
-int ts_nbus_write(struct ts_nbus *ts_nbus, u8 adr, u16 val)
-{
-	int i;
-
-	/* bus access must be atomic */
-	mutex_lock(&ts_nbus->lock);
-
-	/* set the bus in write mode */
-	gpiod_set_value_cansleep(ts_nbus->txrx, 1);
-
-	/* write address */
-	ts_nbus_write_bus(ts_nbus, TS_NBUS_WRITE_ADR, adr);
-
-	/* writing value MSB first */
-	for (i = 1; i >= 0; i--)
-		ts_nbus_write_bus(ts_nbus, TS_NBUS_WRITE_VAL, (u8)(val >> (i * 8)));
-
-	/* wait for completion */
-	gpiod_set_value_cansleep(ts_nbus->csn, 1);
-	while (gpiod_get_value_cansleep(ts_nbus->rdy) != 0) {
-		gpiod_set_value_cansleep(ts_nbus->csn, 0);
-		gpiod_set_value_cansleep(ts_nbus->csn, 1);
-	}
-
-	mutex_unlock(&ts_nbus->lock);
-
-	return 0;
-}
-EXPORT_SYMBOL_GPL(ts_nbus_write);
-
-static int ts_nbus_probe(struct platform_device *pdev)
-{
-	struct pwm_device *pwm;
-	struct pwm_args pargs;
-	struct device *dev = &pdev->dev;
-	struct ts_nbus *ts_nbus;
-	int ret;
-
-	ts_nbus = devm_kzalloc(dev, sizeof(*ts_nbus), GFP_KERNEL);
-	if (!ts_nbus)
-		return -ENOMEM;
-
-	mutex_init(&ts_nbus->lock);
-
-	ret = ts_nbus_init_pdata(pdev, ts_nbus);
-	if (ret < 0)
-		return ret;
-
-	pwm = devm_pwm_get(dev, NULL);
-	if (IS_ERR(pwm)) {
-		ret = PTR_ERR(pwm);
-		if (ret != -EPROBE_DEFER)
-			dev_err(dev, "unable to request PWM\n");
-		return ret;
-	}
-
-	pwm_get_args(pwm, &pargs);
-	if (!pargs.period) {
-		dev_err(&pdev->dev, "invalid PWM period\n");
-		return -EINVAL;
-	}
-
-	/*
-	 * FIXME: pwm_apply_args() should be removed when switching to
-	 * the atomic PWM API.
-	 */
-	pwm_apply_args(pwm);
-	ret = pwm_config(pwm, pargs.period, pargs.period);
-	if (ret < 0)
-		return ret;
-
-	/*
-	 * we can now start the FPGA and populate the peripherals.
-	 */
-	pwm_enable(pwm);
-	ts_nbus->pwm = pwm;
-
-	/*
-	 * let the child nodes retrieve this instance of the ts-nbus.
-	 */
-	dev_set_drvdata(dev, ts_nbus);
-
-	ret = of_platform_populate(dev->of_node, NULL, NULL, dev);
-	if (ret < 0)
-		return ret;
-
-	dev_info(dev, "initialized\n");
-
-	return 0;
-}
-
-static int ts_nbus_remove(struct platform_device *pdev)
-{
-	struct ts_nbus *ts_nbus = dev_get_drvdata(&pdev->dev);
-
-	/* shutdown the FPGA */
-	mutex_lock(&ts_nbus->lock);
-	pwm_disable(ts_nbus->pwm);
-	mutex_unlock(&ts_nbus->lock);
-
-	return 0;
-}
-
-static const struct of_device_id ts_nbus_of_match[] = {
-	{ .compatible = "technologic,ts-nbus", },
-	{ },
-};
-MODULE_DEVICE_TABLE(of, ts_nbus_of_match);
-
-static struct platform_driver ts_nbus_driver = {
-	.probe		= ts_nbus_probe,
-	.remove		= ts_nbus_remove,
-	.driver		= {
-		.name	= "ts_nbus",
-		.of_match_table = ts_nbus_of_match,
-	},
-};
-
-module_platform_driver(ts_nbus_driver);
-
-MODULE_ALIAS("platform:ts_nbus");
-MODULE_AUTHOR("Sebastien Bourdelin <sebastien.bourdelin@savoirfairelinux.com>");
-MODULE_DESCRIPTION("Technologic Systems NBUS");
-MODULE_LICENSE("GPL v2");
diff --git a/include/linux/ts-nbus.h b/include/linux/ts-nbus.h
deleted file mode 100644
index 5bd4c822f7cf..000000000000
--- a/include/linux/ts-nbus.h
+++ /dev/null
@@ -1,18 +0,0 @@ 
-/*
- * Copyright (c) 2016 - Savoir-faire Linux
- * Author: Sebastien Bourdelin <sebastien.bourdelin@savoirfairelinux.com>
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#ifndef _TS_NBUS_H
-#define _TS_NBUS_H
-
-struct ts_nbus;
-
-extern int ts_nbus_read(struct ts_nbus *ts_nbus, u8 adr, u16 *val);
-extern int ts_nbus_write(struct ts_nbus *ts_nbus, u8 adr, u16 val);
-
-#endif /* _TS_NBUS_H */