Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1242477 > unrolled thread

[PATCH] can: at91: remove at91_can_data

Started byAlexandre Belloni <alexandre.belloni@free-electrons.com>
First post2015-10-08 17:00 +0200
Last post2015-10-09 13:00 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] can: at91: remove at91_can_data Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2015-10-08 17:00 +0200
    Re: [PATCH] can: at91: remove at91_can_data Marc Kleine-Budde <mkl@pengutronix.de> - 2015-10-09 12:10 +0200
      Re: [PATCH] can: at91: remove at91_can_data Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2015-10-09 13:00 +0200

#1242477 — [PATCH] can: at91: remove at91_can_data

FromAlexandre Belloni <alexandre.belloni@free-electrons.com>
Date2015-10-08 17:00 +0200
Subject[PATCH] can: at91: remove at91_can_data
Message-ID<qhkPM-6FW-31@gated-at.bofh.it>
struct at91_can_data was used to pass a callback to the driver, allowing it
to switch the transceiver on and off. As all at91 boards are now using DT,
this is not used anymore, remove that structure.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 drivers/net/can/at91_can.c          | 21 ---------------------
 include/linux/platform_data/atmel.h |  5 -----
 2 files changed, 26 deletions(-)

diff --git a/drivers/net/can/at91_can.c b/drivers/net/can/at91_can.c
index 945c0955a967..8b3275d7792a 100644
--- a/drivers/net/can/at91_can.c
+++ b/drivers/net/can/at91_can.c
@@ -8,15 +8,6 @@
  * Public License ("GPL") version 2 as distributed in the 'COPYING'
  * file from the main directory of the linux kernel source.
  *
- *
- * Your platform definition file should specify something like:
- *
- * static struct at91_can_data ek_can_data = {
- *	transceiver_switch = sam9263ek_transceiver_switch,
- * };
- *
- * at91_add_device_can(&ek_can_data);
- *
  */
 
 #include <linux/clk.h>
@@ -33,7 +24,6 @@
 #include <linux/spinlock.h>
 #include <linux/string.h>
 #include <linux/types.h>
-#include <linux/platform_data/atmel.h>
 
 #include <linux/can/dev.h>
 #include <linux/can/error.h>
@@ -324,15 +314,6 @@ static inline u32 at91_can_id_to_reg_mid(canid_t can_id)
 	return reg_mid;
 }
 
-/*
- * Swtich transceiver on or off
- */
-static void at91_transceiver_switch(const struct at91_priv *priv, int on)
-{
-	if (priv->pdata && priv->pdata->transceiver_switch)
-		priv->pdata->transceiver_switch(on);
-}
-
 static void at91_setup_mailboxes(struct net_device *dev)
 {
 	struct at91_priv *priv = netdev_priv(dev);
@@ -416,7 +397,6 @@ static void at91_chip_start(struct net_device *dev)
 
 	at91_set_bittiming(dev);
 	at91_setup_mailboxes(dev);
-	at91_transceiver_switch(priv, 1);
 
 	/* enable chip */
 	if (priv->can.ctrlmode & CAN_CTRLMODE_LISTENONLY)
@@ -444,7 +424,6 @@ static void at91_chip_stop(struct net_device *dev, enum can_state state)
 	reg_mr = at91_read(priv, AT91_MR);
 	at91_write(priv, AT91_MR, reg_mr & ~AT91_MR_CANEN);
 
-	at91_transceiver_switch(priv, 0);
 	priv->can.state = state;
 }
 
diff --git a/include/linux/platform_data/atmel.h b/include/linux/platform_data/atmel.h
index 527a85c61924..c121ddf74f7f 100644
--- a/include/linux/platform_data/atmel.h
+++ b/include/linux/platform_data/atmel.h
@@ -74,11 +74,6 @@ struct atmel_uart_data {
 	struct serial_rs485	rs485;		/* rs485 settings */
 };
 
-/* CAN */
-struct at91_can_data {
-	void (*transceiver_switch)(int on);
-};
-
 /* FIXME: this needs a better location, but gets stuff building again */
 extern int at91_suspend_entering_slow_clock(void);
 
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1243211

FromMarc Kleine-Budde <mkl@pengutronix.de>
Date2015-10-09 12:10 +0200
Message-ID<qhCMG-7p0-19@gated-at.bofh.it>
In reply to#1242477

[Multipart message — attachments visible in raw view] — view raw

On 10/08/2015 04:56 PM, Alexandre Belloni wrote:
> struct at91_can_data was used to pass a callback to the driver, allowing it
> to switch the transceiver on and off. As all at91 boards are now using DT,
> this is not used anymore, remove that structure.

One board was obviously not converted properly to DT. As I don't have to
board to test, I'll apply this patch.

Thanks,
Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |

[toc] | [prev] | [next] | [standalone]


#1243245

FromAlexandre Belloni <alexandre.belloni@free-electrons.com>
Date2015-10-09 13:00 +0200
Message-ID<qhDz4-8iV-23@gated-at.bofh.it>
In reply to#1243211
On 09/10/2015 at 12:07:40 +0200, Marc Kleine-Budde wrote :
> On 10/08/2015 04:56 PM, Alexandre Belloni wrote:
> > struct at91_can_data was used to pass a callback to the driver, allowing it
> > to switch the transceiver on and off. As all at91 boards are now using DT,
> > this is not used anymore, remove that structure.
> 
> One board was obviously not converted properly to DT. As I don't have to
> board to test, I'll apply this patch.
> 

Yeah, we dropped a few mostly unused and untested features when
switching to DT. I have the board but I currently don't have any way to
test CAN properly, I'll submit a patch adding regulator support for the
transceiver once it has been tested.


-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web