Skip to contentSkip to conversation

can: Add driver for esd CAN-USB/2 device

PATCH Superseded Matthias Fuchs 3 participants 3 messages Jul 27, 2010 – Jul 31, 2010 1 message not in the archive

Subsystems (3)

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 can: Add driver for esd CAN-USB/2 device

This patch adds a driver for esd's USB high speed
CAN interface. The driver supports devices with
multiple CAN interfaces.

---
version 4:
- use WARN_ON instead of BUG_ON
- add more error handling (handle esd_us2_send_msg() return code)
- use single point of return from functions where appropriate
- eliminate race condition during stopping/restarting queue

version 3:
- remove bus-error reporting feature because
it cannot be controlled by user on demand
with current device's firmware
- rebased against current net-next-2.6 tree

version 2:
- use bus-error reporting and counters
- minor cleanup
- rebased against current net-next-2.6 tree
- initial post to linux-usb list for review

 drivers/net/can/usb/Kconfig    |    6 +
 drivers/net/can/usb/Makefile   |    1 +
 drivers/net/can/usb/esd_usb2.c | 1137 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 1144 insertions(+), 0 deletions(-)
 create mode 100644 drivers/net/can/usb/esd_usb2.c
drivers/net/can/usb/Kconfig +6 -0
index 97ff6fe..0452549 100644
@@ -7,4 +7,10 @@ config CAN_EMS_USB
 	  This driver is for the one channel CPC-USB/ARM7 CAN/USB interface
 	  from EMS Dr. Thomas Wuensche (http://www.ems-wuensche.de).
 
+config CAN_ESD_USB2
+        tristate "ESD USB/2 CAN/USB interface"
+        ---help---
+          This driver supports the CAN-USB/2 interface
+          from esd electronic system design gmbh (http://www.esd.eu).
+
 endmenu
drivers/net/can/usb/Makefile +1 -0
index 0afd51d..fce3cf1 100644
@@ -3,5 +3,6 @@
 #
 
 obj-$(CONFIG_CAN_EMS_USB) += ems_usb.o
+obj-$(CONFIG_CAN_ESD_USB2) += esd_usb2.o
 
 ccflags-$(CONFIG_CAN_DEBUG_DEVICES) := -DDEBUG
drivers/net/can/usb/esd_usb2.c new file +1137 -0

1,137 lines not on this page · raw message

Signature · 1 line
1.5.6.3

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

From: Matthias Fuchs <[email protected]>
Date: Tue, 27 Jul 2010 15:42:40 +0200

drivers/net/can/usb/esd_usb2.c line 1057

Quoted 4 lines
drivers/net/can/usb/esd_usb2.c new file +4 -0
+#ifdef CONFIG_SYSFS
+	if (device_create_file(&intf->dev, &dev_attr_firmware))
+		dev_err(&intf->dev,
+			"Couldn't create device file for firmware\n");

This ifdef protection is unnecessary, device_create_file() et al. are available always, so please remove these SYSFS ifdef tests.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html