Commit 917f5085 authored by Tilman Schmidt's avatar Tilman Schmidt Committed by Linus Torvalds

[PATCH] isdn4linux: Siemens Gigaset drivers: code cleanup

With Hansjoerg Lipp <hjlipp@web.de>

Source code formatting cleanups for the Siemens Gigaset drivers, such as line
length, comments, removal of unused declarations, and typo corrections.  It
does not introduce any functional changes.
Signed-off-by: default avatarHansjoerg Lipp <hjlipp@web.de>
Signed-off-by: default avatarTilman Schmidt <tilman@imap.cc>
Cc: Karsten Keil <kkeil@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 08a53cdc
......@@ -11,10 +11,6 @@
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
* =====================================================================
* ToDo: ...
* =====================================================================
* Version: $Id: asyncdata.c,v 1.2.2.7 2005/11/13 23:05:18 hjlipp Exp $
* =====================================================================
*/
#include "gigaset.h"
......@@ -58,7 +54,8 @@ static inline int cmd_loop(unsigned char c, unsigned char *src, int numbytes,
dbg(DEBUG_TRANSCMD, "%s: End of Command (%d Bytes)",
__func__, cbytes);
cs->cbytes = cbytes;
gigaset_handle_modem_response(cs); /* can change cs->dle */
gigaset_handle_modem_response(cs); /* can change
cs->dle */
cbytes = 0;
if (cs->dle &&
......@@ -100,7 +97,8 @@ static inline int lock_loop(unsigned char *src, int numbytes,
{
struct cardstate *cs = inbuf->cs;
gigaset_dbg_buffer(DEBUG_LOCKCMD, "received response", numbytes, src, 0);
gigaset_dbg_buffer(DEBUG_LOCKCMD, "received response",
numbytes, src, 0);
gigaset_if_receive(cs, src, numbytes);
return numbytes;
......@@ -392,8 +390,7 @@ void gigaset_m10x_input(struct inbuf_t *inbuf)
if (!(inbuf->inputstate & INS_DLE_char)) {
/* FIXME Einfach je nach Modus Funktionszeiger in cs setzen [hier+hdlc_loop]? */
/* FIXME Spart folgendes "if" und ermoeglicht andere Protokolle */
/* FIXME use function pointers? */
if (inbuf->inputstate & INS_command)
procbytes = cmd_loop(c, src, numbytes, inbuf);
else if (inbuf->bcs->proto2 == ISDN_PROTO_L2_HDLC)
......
......@@ -13,10 +13,6 @@
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
* =====================================================================
* ToDo: ...
* =====================================================================
* Version: $Id: bas-gigaset.c,v 1.52.4.19 2006/02/04 18:28:16 hjlipp Exp $
* =====================================================================
*/
#include "gigaset.h"
......@@ -70,9 +66,6 @@ static struct usb_device_id gigaset_table [] = {
MODULE_DEVICE_TABLE(usb, gigaset_table);
/* Get a minor range for your devices from the usb maintainer */
#define USB_SKEL_MINOR_BASE 200
/*======================= local function prototypes =============================*/
/* This function is called if a new device is connected to the USB port. It
......@@ -240,7 +233,8 @@ static inline void dump_urb(enum debuglevel level, const char *tag,
(unsigned long) urb->context,
(unsigned long) urb->complete);
for (i = 0; i < urb->number_of_packets; i++) {
struct usb_iso_packet_descriptor *pifd = &urb->iso_frame_desc[i];
struct usb_iso_packet_descriptor *pifd
= &urb->iso_frame_desc[i];
dbg(level,
" {offset=%u, length=%u, actual_length=%u, "
"status=%u}",
......@@ -777,10 +771,11 @@ static void read_iso_callback(struct urb *urb, struct pt_regs *regs)
urb->iso_frame_desc[i].actual_length = 0;
}
if (likely(atomic_read(&ubc->running))) {
urb->dev = bcs->cs->hw.bas->udev; /* clobbered by USB subsystem */
urb->dev = bcs->cs->hw.bas->udev; /* clobbered by USB subsystem */
urb->transfer_flags = URB_ISO_ASAP;
urb->number_of_packets = BAS_NUMFRAMES;
dbg(DEBUG_ISO, "%s: isoc read overrun/resubmit", __func__);
dbg(DEBUG_ISO, "%s: isoc read overrun/resubmit",
__func__);
rc = usb_submit_urb(urb, SLAB_ATOMIC);
if (unlikely(rc != 0)) {
err("could not resubmit isochronous read URB: %s",
......@@ -989,7 +984,7 @@ static int submit_iso_write_urb(struct isow_urbctx_t *ucx)
ubc = ucx->bcs->hw.bas;
IFNULLRETVAL(ubc, -EFAULT);
urb->dev = ucx->bcs->cs->hw.bas->udev; /* clobbered by USB subsystem */
urb->dev = ucx->bcs->cs->hw.bas->udev; /* clobbered by USB subsystem */
urb->transfer_flags = URB_ISO_ASAP;
urb->transfer_buffer = ubc->isooutbuf->data;
urb->transfer_buffer_length = sizeof(ubc->isooutbuf->data);
......@@ -1011,7 +1006,8 @@ static int submit_iso_write_urb(struct isow_urbctx_t *ucx)
//dbg(DEBUG_ISO, "%s: frame %d length=%d", __func__, nframe, ifd->length);
/* retrieve block of data to send */
ifd->offset = gigaset_isowbuf_getbytes(ubc->isooutbuf, ifd->length);
ifd->offset = gigaset_isowbuf_getbytes(ubc->isooutbuf,
ifd->length);
if (ifd->offset < 0) {
if (ifd->offset == -EBUSY) {
dbg(DEBUG_ISO, "%s: buffer busy at frame %d",
......@@ -1123,7 +1119,8 @@ static void write_iso_tasklet(unsigned long data)
break;
case -EXDEV: /* inspect individual frames */
/* assumptions (for lack of documentation):
* - actual_length bytes of the frame in error are successfully sent
* - actual_length bytes of the frame in error are
* successfully sent
* - all following frames are not sent at all
*/
dbg(DEBUG_ISO, "%s: URB partially completed", __func__);
......@@ -1260,7 +1257,8 @@ static void read_iso_tasklet(unsigned long data)
switch (urb->status) {
case 0: /* normal completion */
break;
case -EXDEV: /* inspect individual frames (we do that anyway) */
case -EXDEV: /* inspect individual frames
(we do that anyway) */
dbg(DEBUG_ISO, "%s: URB partially completed", __func__);
break;
case -ENOENT:
......@@ -1284,8 +1282,8 @@ static void read_iso_tasklet(unsigned long data)
totleft = urb->actual_length;
for (frame = 0; totleft > 0 && frame < BAS_NUMFRAMES; frame++) {
if (unlikely(urb->iso_frame_desc[frame].status)) {
warn("isochronous read: frame %d: %s",
frame, get_usb_statmsg(urb->iso_frame_desc[frame].status));
warn("isochronous read: frame %d: %s", frame,
get_usb_statmsg(urb->iso_frame_desc[frame].status));
break;
}
numbytes = urb->iso_frame_desc[frame].actual_length;
......@@ -1318,7 +1316,7 @@ static void read_iso_tasklet(unsigned long data)
urb->iso_frame_desc[frame].status = 0;
urb->iso_frame_desc[frame].actual_length = 0;
}
urb->dev = bcs->cs->hw.bas->udev; /* clobbered by USB subsystem */
urb->dev = bcs->cs->hw.bas->udev; /* clobbered by USB subsystem */
urb->transfer_flags = URB_ISO_ASAP;
urb->number_of_packets = BAS_NUMFRAMES;
if ((rc = usb_submit_urb(urb, SLAB_ATOMIC)) != 0) {
......@@ -1792,7 +1790,8 @@ static int start_cbsend(struct cardstate *cs)
* cs controller state structure
* buf command string to send
* len number of bytes to send (max. IF_WRITEBUF)
* wake_tasklet tasklet to run when transmission is completed (NULL if none)
* wake_tasklet tasklet to run when transmission is completed
* (NULL if none)
* return value:
* number of bytes queued on success
* error code < 0 on error
......@@ -1849,7 +1848,8 @@ static int gigaset_write_cmd(struct cardstate *cs,
/* gigaset_write_room
* tty_driver.write_room interface routine
* return number of characters the driver will accept to be written via gigaset_write_cmd
* return number of characters the driver will accept to be written via
* gigaset_write_cmd
* parameter:
* controller state structure
* return value:
......@@ -2299,7 +2299,8 @@ static int __init bas_gigaset_init(void)
goto error;
/* allocate memory for our device state and intialize it */
cardstate = gigaset_initcs(driver, 2, 0, 0, cidmode, GIGASET_MODULENAME);
cardstate = gigaset_initcs(driver, 2, 0, 0, cidmode,
GIGASET_MODULENAME);
if (!cardstate)
goto error;
......
......@@ -11,10 +11,6 @@
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
* =====================================================================
* ToDo: ...
* =====================================================================
* Version: $Id: common.c,v 1.104.4.22 2006/02/04 18:28:16 hjlipp Exp $
* =====================================================================
*/
#include "gigaset.h"
......@@ -101,7 +97,8 @@ void gigaset_dbg_buffer(enum debuglevel level, const unsigned char *msg,
} else {
numin = len < sizeof inbuf ? len : sizeof inbuf;
in = inbuf;
if (copy_from_user(inbuf, (const unsigned char __user *) buf, numin)) {
if (copy_from_user(inbuf, (const unsigned char __user *) buf,
numin)) {
strncpy(inbuf, "<FAULT>", sizeof inbuf);
numin = sizeof "<FAULT>" - 1;
}
......@@ -425,7 +422,8 @@ void gigaset_freecs(struct cardstate *cs)
spin_lock_irqsave(&cs->lock, flags);
atomic_set(&cs->running, 0);
spin_unlock_irqrestore(&cs->lock, flags); /* event handler and timer are not rescheduled below */
spin_unlock_irqrestore(&cs->lock, flags); /* event handler and timer are
not rescheduled below */
tasklet_kill(&cs->event_tasklet);
del_timer_sync(&cs->timer);
......@@ -563,7 +561,6 @@ static struct bc_state *gigaset_initbcs(struct bc_state *bcs,
if (cs->ops->initbcshw(bcs))
return bcs;
//error:
dbg(DEBUG_INIT, " failed");
dbg(DEBUG_INIT, " freeing bcs[%d]->skb", channel);
......@@ -580,7 +577,8 @@ static struct bc_state *gigaset_initbcs(struct bc_state *bcs,
* parameters:
* drv hardware driver the device belongs to
* channels number of B channels supported by device
* onechannel !=0: B channel data and AT commands share one communication channel
* onechannel !=0: B channel data and AT commands share one
* communication channel
* ==0: B channels have separate communication channels
* ignoreframes number of frames to ignore after setting up B channel
* cidmode !=0: start in CallID mode
......@@ -619,7 +617,8 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels,
atomic_set(&cs->ev_tail, 0);
atomic_set(&cs->ev_head, 0);
init_MUTEX_LOCKED(&cs->sem);
tasklet_init(&cs->event_tasklet, &gigaset_handle_event, (unsigned long) cs);
tasklet_init(&cs->event_tasklet, &gigaset_handle_event,
(unsigned long) cs);
atomic_set(&cs->commands_pending, 0);
cs->cur_at_seq = 0;
cs->gotfwver = -1;
......@@ -669,14 +668,6 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels,
cs->curlen = 0;
cs->cmdbytes = 0;
/*
* Tell the ISDN4Linux subsystem (the LL) that
* a driver for a USB-Device is available !
* If this is done, "isdnctrl" is able to bind a device for this driver even
* if no physical usb-device is currently connected.
* But this device will just be accessable if a physical USB device is connected
* (via "gigaset_probe") .
*/
dbg(DEBUG_INIT, "setting up iif");
if (!gigaset_register_to_LL(cs, modulename)) {
err("register_isdn=>error");
......@@ -713,7 +704,8 @@ error: if (cs)
}
EXPORT_SYMBOL_GPL(gigaset_initcs);
/* ReInitialize the b-channel structure */ /* e.g. called on hangup, disconnect */
/* ReInitialize the b-channel structure */
/* e.g. called on hangup, disconnect */
void gigaset_bcs_reinit(struct bc_state *bcs)
{
struct sk_buff *skb;
......@@ -723,7 +715,7 @@ void gigaset_bcs_reinit(struct bc_state *bcs)
while ((skb = skb_dequeue(&bcs->squeue)) != NULL)
dev_kfree_skb(skb);
spin_lock_irqsave(&cs->lock, flags); //FIXME
spin_lock_irqsave(&cs->lock, flags);
clear_at_state(&bcs->at_state);
bcs->at_state.ConState = 0;
bcs->at_state.timer_active = 0;
......@@ -805,7 +797,6 @@ int gigaset_start(struct cardstate *cs)
{
if (down_interruptible(&cs->sem))
return 0;
//info("USB device for Gigaset 307x now attached to Dev %d", ucs->minor);
atomic_set(&cs->connected, 1);
......@@ -954,7 +945,8 @@ void gigaset_debugdrivers(void)
dbg(DEBUG_DRIVER, " flags 0x%02x", drv->flags[i]);
cs = drv->cs + i;
dbg(DEBUG_DRIVER, " cardstate %p", cs);
dbg(DEBUG_DRIVER, " minor_index %u", cs->minor_index);
dbg(DEBUG_DRIVER, " minor_index %u",
cs->minor_index);
dbg(DEBUG_DRIVER, " driver %p", cs->driver);
dbg(DEBUG_DRIVER, " i4l id %d", cs->myid);
}
......@@ -1016,7 +1008,7 @@ EXPORT_SYMBOL_GPL(gigaset_freedriver);
* parameters:
* minor First minor number
* minors Number of minors this driver can handle
* procname Name of the driver (e.g. for /proc/tty/drivers, path in /proc/driver)
* procname Name of the driver
* devname Name of the device files (prefix without minor number)
* devfsname Devfs name of the device files without %d
* return value:
......
This diff is collapsed.
This diff is collapsed.
......@@ -11,10 +11,6 @@
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
* =====================================================================
* ToDo: ...
* =====================================================================
* Version: $Id: i4l.c,v 1.3.2.9 2006/02/04 18:28:16 hjlipp Exp $
* =====================================================================
*/
#include "gigaset.h"
......@@ -29,7 +25,8 @@
* parameters:
* driverID driver ID as assigned by LL
* channel channel number
* ack if != 0 LL wants to be notified on completion via statcallb(ISDN_STAT_BSENT)
* ack if != 0 LL wants to be notified on completion via
* statcallb(ISDN_STAT_BSENT)
* skb skb containing data to send
* return value:
* number of accepted bytes
......@@ -123,9 +120,6 @@ static int command_from_LL(isdn_ctrl *cntrl)
//dbg(DEBUG_ANY, "Gigaset_HW: Receiving command");
gigaset_debugdrivers();
/* Terminate this call if no device is present. Bt if the command is "ISDN_CMD_LOCK" or
* "ISDN_CMD_UNLOCK" then execute it due to the fact that they are device independent !
*/
//FIXME "remove test for &connected"
if ((!cs || !atomic_read(&cs->connected))) {
warn("LL tried to access unknown device with nr. %d",
......@@ -222,15 +216,15 @@ static int command_from_LL(isdn_ctrl *cntrl)
gigaset_schedule_event(cs);
break;
case ISDN_CMD_CLREAZ: /* Do not signal incoming signals */ //FIXME
case ISDN_CMD_CLREAZ: /* Do not signal incoming signals */ //FIXME
dbg(DEBUG_ANY, "ISDN_CMD_CLREAZ");
break;
case ISDN_CMD_SETEAZ: /* Signal incoming calls for given MSN */ //FIXME
case ISDN_CMD_SETEAZ: /* Signal incoming calls for given MSN */ //FIXME
dbg(DEBUG_ANY,
"ISDN_CMD_SETEAZ (id:%d, channel: %ld, number: %s)",
cntrl->driver, cntrl->arg, cntrl->parm.num);
break;
case ISDN_CMD_SETL2: /* Set L2 to given protocol */
case ISDN_CMD_SETL2: /* Set L2 to given protocol */
dbg(DEBUG_ANY, "ISDN_CMD_SETL2 (Channel: %ld, Proto: %lx)",
cntrl->arg & 0xff, (cntrl->arg >> 8));
......@@ -250,7 +244,7 @@ static int command_from_LL(isdn_ctrl *cntrl)
dbg(DEBUG_CMD, "scheduling PROTO_L2");
gigaset_schedule_event(cs);
break;
case ISDN_CMD_SETL3: /* Set L3 to given protocol */
case ISDN_CMD_SETL3: /* Set L3 to given protocol */
dbg(DEBUG_ANY, "ISDN_CMD_SETL3 (Channel: %ld, Proto: %lx)",
cntrl->arg & 0xff, (cntrl->arg >> 8));
......@@ -396,10 +390,14 @@ int gigaset_isdn_setup_dial(struct at_state_t *at_state, void *data)
}
if (bcs->commands[AT_MSN])
snprintf(bcs->commands[AT_MSN], length[AT_MSN], "^SMSN=%s\r", sp->eazmsn);
snprintf(bcs->commands[AT_BC ], length[AT_BC ], "^SBC=%s\r", bc);
snprintf(bcs->commands[AT_PROTO], length[AT_PROTO], "^SBPR=%u\r", proto);
snprintf(bcs->commands[AT_ISO ], length[AT_ISO ], "^SISO=%u\r", (unsigned)bcs->channel + 1);
snprintf(bcs->commands[AT_MSN], length[AT_MSN],
"^SMSN=%s\r", sp->eazmsn);
snprintf(bcs->commands[AT_BC ], length[AT_BC ],
"^SBC=%s\r", bc);
snprintf(bcs->commands[AT_PROTO], length[AT_PROTO],
"^SBPR=%u\r", proto);
snprintf(bcs->commands[AT_ISO ], length[AT_ISO ],
"^SISO=%u\r", (unsigned)bcs->channel + 1);
return 0;
}
......@@ -441,8 +439,10 @@ int gigaset_isdn_setup_accept(struct at_state_t *at_state)
}
}
snprintf(bcs->commands[AT_PROTO], length[AT_PROTO], "^SBPR=%u\r", proto);
snprintf(bcs->commands[AT_ISO ], length[AT_ISO ], "^SISO=%u\r", (unsigned) bcs->channel + 1);
snprintf(bcs->commands[AT_PROTO], length[AT_PROTO],
"^SBPR=%u\r", proto);
snprintf(bcs->commands[AT_ISO ], length[AT_ISO ],
"^SISO=%u\r", (unsigned) bcs->channel + 1);
return 0;
}
......@@ -542,9 +542,9 @@ int gigaset_register_to_LL(struct cardstate *cs, const char *isdnid)
return -ENOMEM; //FIXME EINVAL/...??
iif->owner = THIS_MODULE;
iif->channels = cs->channels; /* I am supporting just one channel *//* I was supporting...*/
iif->channels = cs->channels;
iif->maxbufsize = MAX_BUF_SIZE;
iif->features = ISDN_FEATURE_L2_TRANS | /* Our device is very advanced, therefore */
iif->features = ISDN_FEATURE_L2_TRANS |
ISDN_FEATURE_L2_HDLC |
#ifdef GIG_X75
ISDN_FEATURE_L2_X75I |
......
......@@ -9,8 +9,6 @@
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
* =====================================================================
* Version: $Id: interface.c,v 1.14.4.15 2006/02/04 18:28:16 hjlipp Exp $
* =====================================================================
*/
#include "gigaset.h"
......@@ -173,7 +171,6 @@ static int if_open(struct tty_struct *tty, struct file *filp)
cs->tty = tty;
spin_unlock_irqrestore(&cs->lock, flags);
tty->low_latency = 1; //FIXME test
//FIXME
}
up(&cs->sem);
......@@ -202,7 +199,6 @@ static void if_close(struct tty_struct *tty, struct file *filp)
spin_lock_irqsave(&cs->lock, flags);
cs->tty = NULL;
spin_unlock_irqrestore(&cs->lock, flags);
//FIXME
}
}
......@@ -253,24 +249,26 @@ static int if_ioctl(struct tty_struct *tty, struct file *file,
gigaset_dbg_buffer(DEBUG_IF, "GIGASET_BRKCHARS",
6, (const unsigned char *) arg, 1);
if (!atomic_read(&cs->connected)) {
dbg(DEBUG_ANY, "can't communicate with unplugged device");
dbg(DEBUG_ANY,
"can't communicate with unplugged device");
retval = -ENODEV;
break;
}
retval = copy_from_user(&buf,
(const unsigned char __user *) arg, 6)
(const unsigned char __user *) arg, 6)
? -EFAULT : 0;
if (retval >= 0)
retval = cs->ops->brkchars(cs, buf);
break;
case GIGASET_VERSION:
retval = copy_from_user(version, (unsigned __user *) arg,
retval = copy_from_user(version,
(unsigned __user *) arg,
sizeof version) ? -EFAULT : 0;
if (retval >= 0)
retval = if_version(cs, version);
if (retval >= 0)
retval = copy_to_user((unsigned __user *) arg, version,
sizeof version)
retval = copy_to_user((unsigned __user *) arg,
version, sizeof version)
? -EFAULT : 0;
break;
default:
......@@ -575,7 +573,7 @@ static void if_set_termios(struct tty_struct *tty, struct termios *old)
new_state &= ~(TIOCM_DTR | TIOCM_RTS);
if (new_state != control_state) {
dbg(DEBUG_IF, "%u: new_state %x", cs->minor_index, new_state);
gigaset_set_modem_ctrl(cs, control_state, new_state); // FIXME: mct_u232.c sets the old state here. is this a bug?
gigaset_set_modem_ctrl(cs, control_state, new_state);
control_state = new_state;
}
#endif
......
......@@ -10,10 +10,6 @@
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
* =====================================================================
* ToDo: ...
* =====================================================================
* Version: $Id: isocdata.c,v 1.2.2.5 2005/11/13 23:05:19 hjlipp Exp $
* =====================================================================
*/
#include "gigaset.h"
......@@ -196,7 +192,8 @@ int gigaset_isowbuf_getbytes(struct isowbuf_t *iwb, int size)
return -EBUSY;
/* write position could have changed */
if (limit >= (write = atomic_read(&iwb->write))) {
pbyte = iwb->data[write]; /* save partial byte */
pbyte = iwb->data[write]; /* save
partial byte */
limit = write + BAS_OUTBUFPAD;
dbg(DEBUG_STREAM,
"%s: filling %d->%d with %02x",
......@@ -213,7 +210,8 @@ int gigaset_isowbuf_getbytes(struct isowbuf_t *iwb, int size)
}
dbg(DEBUG_STREAM, "%s: restoring %02x at %d",
__func__, pbyte, limit);
iwb->data[limit] = pbyte; /* restore partial byte */
iwb->data[limit] = pbyte; /* restore
partial byte */
atomic_set(&iwb->write, limit);
}
isowbuf_donewrite(iwb);
......@@ -508,11 +506,13 @@ int gigaset_isoc_buildframe(struct bc_state *bcs, unsigned char *in, int len)
switch (bcs->proto2) {
case ISDN_PROTO_L2_HDLC:
result = hdlc_buildframe(bcs->hw.bas->isooutbuf, in, len);
dbg(DEBUG_ISO, "%s: %d bytes HDLC -> %d", __func__, len, result);
dbg(DEBUG_ISO, "%s: %d bytes HDLC -> %d",
__func__, len, result);
break;
default: /* assume transparent */
result = trans_buildframe(bcs->hw.bas->isooutbuf, in, len);
dbg(DEBUG_ISO, "%s: %d bytes trans -> %d", __func__, len, result);
dbg(DEBUG_ISO, "%s: %d bytes trans -> %d",
__func__, len, result);
}
return result;
}
......
......@@ -11,23 +11,21 @@
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
* =====================================================================
* ToDo: ...
* =====================================================================
* Version: $Id: proc.c,v 1.5.2.13 2006/02/04 18:28:16 hjlipp Exp $
* =====================================================================
*/
#include "gigaset.h"
#include <linux/ctype.h>
static ssize_t show_cidmode(struct device *dev, struct device_attribute *attr, char *buf)
static ssize_t show_cidmode(struct device *dev, struct device_attribute *attr,
char *buf)
{
struct usb_interface *intf = to_usb_interface(dev);
struct cardstate *cs = usb_get_intfdata(intf);
return sprintf(buf, "%d\n", atomic_read(&cs->cidmode)); // FIXME use scnprintf for 13607 bit architectures (if PAGE_SIZE==4096)
return sprintf(buf, "%d\n", atomic_read(&cs->cidmode));
}
static ssize_t set_cidmode(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
static ssize_t set_cidmode(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
struct usb_interface *intf = to_usb_interface(dev);
struct cardstate *cs = usb_get_intfdata(intf);
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment