[PATCH] W1: Sync with w1/ds9490 tree.

Whitespace, static/nonstatic cleanups.

Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Evgeniy Polyakov 2005-08-03 15:14:50 +04:00 committed by Greg Kroah-Hartman
parent 2d8331792e
commit 8949d2aa05
3 changed files with 99 additions and 96 deletions

View File

@ -1,5 +1,5 @@
/*
* ds_w1_bridge.c
* ds_w1_bridge.c
*
* Copyright (c) 2004 Evgeniy Polyakov <johnpol@2ka.mipt.ru>
*
@ -136,14 +136,14 @@ static int __devinit ds_w1_init(void)
memset(ds_bus_master, 0, sizeof(*ds_bus_master));
ds_bus_master->data = (unsigned long)ds_dev;
ds_bus_master->touch_bit = &ds9490r_touch_bit;
ds_bus_master->read_bit = &ds9490r_read_bit;
ds_bus_master->write_bit = &ds9490r_write_bit;
ds_bus_master->read_byte = &ds9490r_read_byte;
ds_bus_master->write_byte = &ds9490r_write_byte;
ds_bus_master->read_block = &ds9490r_read_block;
ds_bus_master->write_block = &ds9490r_write_block;
ds_bus_master->data = (unsigned long)ds_dev;
ds_bus_master->touch_bit = &ds9490r_touch_bit;
ds_bus_master->read_bit = &ds9490r_read_bit;
ds_bus_master->write_bit = &ds9490r_write_bit;
ds_bus_master->read_byte = &ds9490r_read_byte;
ds_bus_master->write_byte = &ds9490r_write_byte;
ds_bus_master->read_block = &ds9490r_read_block;
ds_bus_master->write_block = &ds9490r_write_block;
ds_bus_master->reset_bus = &ds9490r_reset;
err = w1_add_master_device(ds_bus_master);

View File

@ -1,5 +1,5 @@
/*
* dscore.c
* dscore.c
*
* Copyright (c) 2004 Evgeniy Polyakov <johnpol@2ka.mipt.ru>
*
@ -32,19 +32,16 @@ static struct usb_device_id ds_id_table [] = {
};
MODULE_DEVICE_TABLE(usb, ds_id_table);
int ds_probe(struct usb_interface *, const struct usb_device_id *);
void ds_disconnect(struct usb_interface *);
static int ds_probe(struct usb_interface *, const struct usb_device_id *);
static void ds_disconnect(struct usb_interface *);
int ds_touch_bit(struct ds_device *, u8, u8 *);
int ds_read_byte(struct ds_device *, u8 *);
int ds_read_bit(struct ds_device *, u8 *);
int ds_write_byte(struct ds_device *, u8);
int ds_write_bit(struct ds_device *, u8);
int ds_start_pulse(struct ds_device *, int);
int ds_set_speed(struct ds_device *, int);
static int ds_start_pulse(struct ds_device *, int);
int ds_reset(struct ds_device *, struct ds_status *);
int ds_detect(struct ds_device *, struct ds_status *);
int ds_stop_pulse(struct ds_device *, int);
struct ds_device * ds_get_device(void);
void ds_put_device(struct ds_device *);
@ -126,7 +123,8 @@ static inline void ds_dump_status(unsigned char *buf, unsigned char *str, int of
printk("%45s: %8x\n", str, buf[off]);
}
int ds_recv_status_nodump(struct ds_device *dev, struct ds_status *st, unsigned char *buf, int size)
static int ds_recv_status_nodump(struct ds_device *dev, struct ds_status *st,
unsigned char *buf, int size)
{
int count, err;
@ -245,6 +243,8 @@ static int ds_send_data(struct ds_device *dev, unsigned char *buf, int len)
return err;
}
#if 0
int ds_stop_pulse(struct ds_device *dev, int limit)
{
struct ds_status st;
@ -297,7 +297,9 @@ int ds_detect(struct ds_device *dev, struct ds_status *st)
return err;
}
int ds_wait_status(struct ds_device *dev, struct ds_status *st)
#endif /* 0 */
static int ds_wait_status(struct ds_device *dev, struct ds_status *st)
{
u8 buf[0x20];
int err, count = 0;
@ -319,10 +321,8 @@ int ds_wait_status(struct ds_device *dev, struct ds_status *st)
if (((err > 16) && (buf[0x10] & 0x01)) || count >= 100 || err < 0) {
ds_recv_status(dev, st);
return -1;
}
else {
} else
return 0;
}
}
int ds_reset(struct ds_device *dev, struct ds_status *st)
@ -345,6 +345,7 @@ int ds_reset(struct ds_device *dev, struct ds_status *st)
return 0;
}
#if 0
int ds_set_speed(struct ds_device *dev, int speed)
{
int err;
@ -363,8 +364,9 @@ int ds_set_speed(struct ds_device *dev, int speed)
return err;
}
#endif /* 0 */
int ds_start_pulse(struct ds_device *dev, int delay)
static int ds_start_pulse(struct ds_device *dev, int delay)
{
int err;
u8 del = 1 + (u8)(delay >> 4);
@ -552,6 +554,8 @@ int ds_write_block(struct ds_device *dev, u8 *buf, int len)
return !(err == len);
}
#if 0
int ds_search(struct ds_device *dev, u64 init, u64 *buf, u8 id_number, int conditional_search)
{
int err;
@ -625,7 +629,10 @@ int ds_set_path(struct ds_device *dev, u64 init)
return 0;
}
int ds_probe(struct usb_interface *intf, const struct usb_device_id *udev_id)
#endif /* 0 */
static int ds_probe(struct usb_interface *intf,
const struct usb_device_id *udev_id)
{
struct usb_device *udev = interface_to_usbdev(intf);
struct usb_endpoint_descriptor *endpoint;
@ -720,7 +727,7 @@ int ds_probe(struct usb_interface *intf, const struct usb_device_id *udev_id)
return 0;
}
void ds_disconnect(struct usb_interface *intf)
static void ds_disconnect(struct usb_interface *intf)
{
struct ds_device *dev;
@ -740,7 +747,7 @@ void ds_disconnect(struct usb_interface *intf)
ds_dev = NULL;
}
int ds_init(void)
static int ds_init(void)
{
int err;
@ -753,7 +760,7 @@ int ds_init(void)
return 0;
}
void ds_fini(void)
static void ds_fini(void)
{
usb_deregister(&ds_driver);
}

View File

@ -1,5 +1,5 @@
/*
* dscore.h
* dscore.h
*
* Copyright (c) 2004 Evgeniy Polyakov <johnpol@2ka.mipt.ru>
*
@ -122,7 +122,7 @@
struct ds_device
{
struct usb_device *udev;
struct usb_device *udev;
struct usb_interface *intf;
int ep[NUM_EP];
@ -156,11 +156,7 @@ int ds_read_byte(struct ds_device *, u8 *);
int ds_read_bit(struct ds_device *, u8 *);
int ds_write_byte(struct ds_device *, u8);
int ds_write_bit(struct ds_device *, u8);
int ds_start_pulse(struct ds_device *, int);
int ds_set_speed(struct ds_device *, int);
int ds_reset(struct ds_device *, struct ds_status *);
int ds_detect(struct ds_device *, struct ds_status *);
int ds_stop_pulse(struct ds_device *, int);
struct ds_device * ds_get_device(void);
void ds_put_device(struct ds_device *);
int ds_write_block(struct ds_device *, u8 *, int);