linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] can: at91: remove at91_can_data
@ 2015-10-08 14:56 Alexandre Belloni
  2015-10-09 10:07 ` Marc Kleine-Budde
  0 siblings, 1 reply; 3+ messages in thread
From: Alexandre Belloni @ 2015-10-08 14:56 UTC (permalink / raw)
  To: linux-arm-kernel

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

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

* [PATCH] can: at91: remove at91_can_data
  2015-10-08 14:56 [PATCH] can: at91: remove at91_can_data Alexandre Belloni
@ 2015-10-09 10:07 ` Marc Kleine-Budde
  2015-10-09 10:51   ` Alexandre Belloni
  0 siblings, 1 reply; 3+ messages in thread
From: Marc Kleine-Budde @ 2015-10-09 10:07 UTC (permalink / raw)
  To: linux-arm-kernel

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   |

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20151009/f2d386db/attachment.sig>

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

* [PATCH] can: at91: remove at91_can_data
  2015-10-09 10:07 ` Marc Kleine-Budde
@ 2015-10-09 10:51   ` Alexandre Belloni
  0 siblings, 0 replies; 3+ messages in thread
From: Alexandre Belloni @ 2015-10-09 10:51 UTC (permalink / raw)
  To: linux-arm-kernel

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

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

end of thread, other threads:[~2015-10-09 10:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-08 14:56 [PATCH] can: at91: remove at91_can_data Alexandre Belloni
2015-10-09 10:07 ` Marc Kleine-Budde
2015-10-09 10:51   ` 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).