Commit c4104fd8 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Linus Torvalds

[PATCH] parport: kill dead code and exports

There's lots of exports in parport that aren't used by any drivers.  Behind
many of them there's actually dead code.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 33cf5414
...@@ -207,8 +207,7 @@ void parport_daisy_fini (struct parport *port) ...@@ -207,8 +207,7 @@ void parport_daisy_fini (struct parport *port)
* *
* This function is similar to parport_register_device(), except * This function is similar to parport_register_device(), except
* that it locates a device by its number rather than by the port * that it locates a device by its number rather than by the port
* it is attached to. See parport_find_device() and * it is attached to.
* parport_find_class().
* *
* All parameters except for @devnum are the same as for * All parameters except for @devnum are the same as for
* parport_register_device(). The return value is the same as * parport_register_device(). The return value is the same as
...@@ -305,53 +304,6 @@ int parport_device_num (int parport, int mux, int daisy) ...@@ -305,53 +304,6 @@ int parport_device_num (int parport, int mux, int daisy)
return res; return res;
} }
/**
* parport_device_coords - convert canonical device number
* @devnum: device number
* @parport: pointer to storage for parallel port number
* @mux: pointer to storage for multiplexor port number
* @daisy: pointer to storage for daisy chain address
*
* This function converts a device number into its coordinates in
* terms of which parallel port in the system it is attached to,
* which multiplexor port it is attached to if there is a
* multiplexor on that port, and which daisy chain address it has
* if it is in a daisy chain.
*
* The caller must allocate storage for @parport, @mux, and
* @daisy.
*
* If there is no device with the specified device number, -ENXIO
* is returned. Otherwise, the values pointed to by @parport,
* @mux, and @daisy are set to the coordinates of the device,
* with -1 for coordinates with no value.
*
* This function is not actually very useful, but this interface
* was suggested by IEEE 1284.3.
**/
int parport_device_coords (int devnum, int *parport, int *mux, int *daisy)
{
struct daisydev *dev;
spin_lock(&topology_lock);
dev = topology;
while (dev && dev->devnum != devnum)
dev = dev->next;
if (!dev) {
spin_unlock(&topology_lock);
return -ENXIO;
}
if (parport) *parport = dev->port->portnum;
if (mux) *mux = dev->port->muxport;
if (daisy) *daisy = dev->daisy;
spin_unlock(&topology_lock);
return 0;
}
/* Send a daisy-chain-style CPP command packet. */ /* Send a daisy-chain-style CPP command packet. */
static int cpp_daisy (struct parport *port, int cmd) static int cpp_daisy (struct parport *port, int cmd)
{ {
...@@ -558,108 +510,3 @@ static int assign_addrs (struct parport *port) ...@@ -558,108 +510,3 @@ static int assign_addrs (struct parport *port)
kfree (deviceid); kfree (deviceid);
return detected; return detected;
} }
/* Find a device with a particular manufacturer and model string,
starting from a given device number. Like the PCI equivalent,
'from' itself is skipped. */
/**
* parport_find_device - find a specific device
* @mfg: required manufacturer string
* @mdl: required model string
* @from: previous device number found in search, or %NULL for
* new search
*
* This walks through the list of parallel port devices looking
* for a device whose 'MFG' string matches @mfg and whose 'MDL'
* string matches @mdl in their IEEE 1284 Device ID.
*
* When a device is found matching those requirements, its device
* number is returned; if there is no matching device, a negative
* value is returned.
*
* A new search it initiated by passing %NULL as the @from
* argument. If @from is not %NULL, the search continues from
* that device.
**/
int parport_find_device (const char *mfg, const char *mdl, int from)
{
struct daisydev *d;
int res = -1;
/* Find where to start. */
spin_lock(&topology_lock);
d = topology; /* sorted by devnum */
while (d && d->devnum <= from)
d = d->next;
/* Search. */
while (d) {
struct parport_device_info *info;
info = &d->port->probe_info[1 + d->daisy];
if ((!mfg || !strcmp (mfg, info->mfr)) &&
(!mdl || !strcmp (mdl, info->model)))
break;
d = d->next;
}
if (d)
res = d->devnum;
spin_unlock(&topology_lock);
return res;
}
/**
* parport_find_class - find a device in a specified class
* @cls: required class
* @from: previous device number found in search, or %NULL for
* new search
*
* This walks through the list of parallel port devices looking
* for a device whose 'CLS' string matches @cls in their IEEE
* 1284 Device ID.
*
* When a device is found matching those requirements, its device
* number is returned; if there is no matching device, a negative
* value is returned.
*
* A new search it initiated by passing %NULL as the @from
* argument. If @from is not %NULL, the search continues from
* that device.
**/
int parport_find_class (parport_device_class cls, int from)
{
struct daisydev *d;
int res = -1;
spin_lock(&topology_lock);
d = topology; /* sorted by devnum */
/* Find where to start. */
while (d && d->devnum <= from)
d = d->next;
/* Search. */
while (d && d->port->probe_info[1 + d->daisy].class != cls)
d = d->next;
if (d)
res = d->devnum;
spin_unlock(&topology_lock);
return res;
}
EXPORT_SYMBOL(parport_open);
EXPORT_SYMBOL(parport_close);
EXPORT_SYMBOL(parport_device_num);
EXPORT_SYMBOL(parport_device_coords);
EXPORT_SYMBOL(parport_daisy_deselect_all);
EXPORT_SYMBOL(parport_daisy_select);
EXPORT_SYMBOL(parport_daisy_init);
EXPORT_SYMBOL(parport_find_device);
EXPORT_SYMBOL(parport_find_class);
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
/* Make parport_wait_peripheral wake up. /* Make parport_wait_peripheral wake up.
* It will be useful to call this from an interrupt handler. */ * It will be useful to call this from an interrupt handler. */
void parport_ieee1284_wakeup (struct parport *port) static void parport_ieee1284_wakeup (struct parport *port)
{ {
up (&port->physport->ieee1284.irq); up (&port->physport->ieee1284.irq);
} }
...@@ -813,9 +813,7 @@ long parport_set_timeout (struct pardevice *dev, long inactivity) ...@@ -813,9 +813,7 @@ long parport_set_timeout (struct pardevice *dev, long inactivity)
EXPORT_SYMBOL(parport_negotiate); EXPORT_SYMBOL(parport_negotiate);
EXPORT_SYMBOL(parport_write); EXPORT_SYMBOL(parport_write);
EXPORT_SYMBOL(parport_read); EXPORT_SYMBOL(parport_read);
EXPORT_SYMBOL(parport_ieee1284_wakeup);
EXPORT_SYMBOL(parport_wait_peripheral); EXPORT_SYMBOL(parport_wait_peripheral);
EXPORT_SYMBOL(parport_poll_peripheral);
EXPORT_SYMBOL(parport_wait_event); EXPORT_SYMBOL(parport_wait_event);
EXPORT_SYMBOL(parport_set_timeout); EXPORT_SYMBOL(parport_set_timeout);
EXPORT_SYMBOL(parport_ieee1284_interrupt); EXPORT_SYMBOL(parport_ieee1284_interrupt);
...@@ -213,4 +213,3 @@ ssize_t parport_device_id (int devnum, char *buffer, size_t len) ...@@ -213,4 +213,3 @@ ssize_t parport_device_id (int devnum, char *buffer, size_t len)
parport_close (dev); parport_close (dev);
return retval; return retval;
} }
EXPORT_SYMBOL(parport_device_id);
...@@ -529,8 +529,5 @@ static void __exit parport_default_proc_unregister (void) ...@@ -529,8 +529,5 @@ static void __exit parport_default_proc_unregister (void)
} }
#endif #endif
EXPORT_SYMBOL(parport_device_proc_register);
EXPORT_SYMBOL(parport_device_proc_unregister);
module_init(parport_default_proc_register) module_init(parport_default_proc_register)
module_exit(parport_default_proc_unregister) module_exit(parport_default_proc_unregister)
...@@ -1007,7 +1007,6 @@ EXPORT_SYMBOL(parport_register_driver); ...@@ -1007,7 +1007,6 @@ EXPORT_SYMBOL(parport_register_driver);
EXPORT_SYMBOL(parport_unregister_driver); EXPORT_SYMBOL(parport_unregister_driver);
EXPORT_SYMBOL(parport_register_device); EXPORT_SYMBOL(parport_register_device);
EXPORT_SYMBOL(parport_unregister_device); EXPORT_SYMBOL(parport_unregister_device);
EXPORT_SYMBOL(parport_get_port);
EXPORT_SYMBOL(parport_put_port); EXPORT_SYMBOL(parport_put_port);
EXPORT_SYMBOL(parport_find_number); EXPORT_SYMBOL(parport_find_number);
EXPORT_SYMBOL(parport_find_base); EXPORT_SYMBOL(parport_find_base);
......
...@@ -466,7 +466,6 @@ extern int parport_poll_peripheral (struct parport *port, ...@@ -466,7 +466,6 @@ extern int parport_poll_peripheral (struct parport *port,
int usec); int usec);
/* For architectural drivers */ /* For architectural drivers */
extern void parport_ieee1284_wakeup (struct parport *port);
extern size_t parport_ieee1284_write_compat (struct parport *, extern size_t parport_ieee1284_write_compat (struct parport *,
const void *, size_t, int); const void *, size_t, int);
extern size_t parport_ieee1284_read_nibble (struct parport *, extern size_t parport_ieee1284_read_nibble (struct parport *,
...@@ -500,21 +499,9 @@ extern struct pardevice *parport_open (int devnum, const char *name, ...@@ -500,21 +499,9 @@ extern struct pardevice *parport_open (int devnum, const char *name,
extern void parport_close (struct pardevice *dev); extern void parport_close (struct pardevice *dev);
extern ssize_t parport_device_id (int devnum, char *buffer, size_t len); extern ssize_t parport_device_id (int devnum, char *buffer, size_t len);
extern int parport_device_num (int parport, int mux, int daisy); extern int parport_device_num (int parport, int mux, int daisy);
extern int parport_device_coords (int devnum, int *parport, int *mux,
int *daisy);
extern void parport_daisy_deselect_all (struct parport *port); extern void parport_daisy_deselect_all (struct parport *port);
extern int parport_daisy_select (struct parport *port, int daisy, int mode); extern int parport_daisy_select (struct parport *port, int daisy, int mode);
/* For finding devices based on their device ID. Example usage:
int devnum = -1;
while ((devnum = parport_find_class (PARPORT_CLASS_DIGCAM, devnum)) != -1) {
struct pardevice *dev = parport_open (devnum, ...);
...
}
*/
extern int parport_find_device (const char *mfg, const char *mdl, int from);
extern int parport_find_class (parport_device_class cls, int from);
/* Lowlevel drivers _can_ call this support function to handle irqs. */ /* Lowlevel drivers _can_ call this support function to handle irqs. */
static __inline__ void parport_generic_irq(int irq, struct parport *port, static __inline__ void parport_generic_irq(int irq, struct parport *port,
struct pt_regs *regs) struct pt_regs *regs)
......
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