mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-01 10:45:49 +00:00
pcmcia: remove unused flag, simplify headers
As we only provide one way to set up resources now, we can remove the resource-setup-related bitfield (except resource_setup_done). In addition, pcmcia_state only consisted of one entry, so remove this bitfield as well. Suggested-by: Komuro <komurojun-mbn@nifty.com> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
This commit is contained in:
parent
134716f19b
commit
ce3f9d71bd
@ -294,7 +294,7 @@ static int pcmcia_device_probe(struct device *dev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
mutex_lock(&s->ops_mutex);
|
mutex_lock(&s->ops_mutex);
|
||||||
if ((s->pcmcia_state.has_pfc) &&
|
if ((s->pcmcia_pfc) &&
|
||||||
(p_dev->socket->device_count == 1) && (p_dev->device_no == 0))
|
(p_dev->socket->device_count == 1) && (p_dev->device_no == 0))
|
||||||
pcmcia_parse_uevents(s, PCMCIA_UEVENT_REQUERY);
|
pcmcia_parse_uevents(s, PCMCIA_UEVENT_REQUERY);
|
||||||
mutex_unlock(&s->ops_mutex);
|
mutex_unlock(&s->ops_mutex);
|
||||||
@ -359,7 +359,7 @@ static int pcmcia_device_remove(struct device *dev)
|
|||||||
* pseudo multi-function card, we need to unbind
|
* pseudo multi-function card, we need to unbind
|
||||||
* all devices
|
* all devices
|
||||||
*/
|
*/
|
||||||
if ((p_dev->socket->pcmcia_state.has_pfc) &&
|
if ((p_dev->socket->pcmcia_pfc) &&
|
||||||
(p_dev->socket->device_count > 0) &&
|
(p_dev->socket->device_count > 0) &&
|
||||||
(p_dev->device_no == 0))
|
(p_dev->device_no == 0))
|
||||||
pcmcia_card_remove(p_dev->socket, p_dev);
|
pcmcia_card_remove(p_dev->socket, p_dev);
|
||||||
@ -681,7 +681,7 @@ static void pcmcia_requery(struct pcmcia_socket *s)
|
|||||||
* call pcmcia_device_add() -- which will fail if both
|
* call pcmcia_device_add() -- which will fail if both
|
||||||
* devices are already registered. */
|
* devices are already registered. */
|
||||||
mutex_lock(&s->ops_mutex);
|
mutex_lock(&s->ops_mutex);
|
||||||
has_pfc = s->pcmcia_state.has_pfc;
|
has_pfc = s->pcmcia_pfc;
|
||||||
mutex_unlock(&s->ops_mutex);
|
mutex_unlock(&s->ops_mutex);
|
||||||
if (has_pfc)
|
if (has_pfc)
|
||||||
pcmcia_device_add(s, 0);
|
pcmcia_device_add(s, 0);
|
||||||
@ -813,7 +813,7 @@ static inline int pcmcia_devmatch(struct pcmcia_device *dev,
|
|||||||
if (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) {
|
if (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) {
|
||||||
dev_dbg(&dev->dev, "this is a pseudo-multi-function device\n");
|
dev_dbg(&dev->dev, "this is a pseudo-multi-function device\n");
|
||||||
mutex_lock(&dev->socket->ops_mutex);
|
mutex_lock(&dev->socket->ops_mutex);
|
||||||
dev->socket->pcmcia_state.has_pfc = 1;
|
dev->socket->pcmcia_pfc = 1;
|
||||||
mutex_unlock(&dev->socket->ops_mutex);
|
mutex_unlock(&dev->socket->ops_mutex);
|
||||||
if (dev->device_no != did->device_no)
|
if (dev->device_no != did->device_no)
|
||||||
return 0;
|
return 0;
|
||||||
@ -827,7 +827,7 @@ static inline int pcmcia_devmatch(struct pcmcia_device *dev,
|
|||||||
|
|
||||||
/* if this is a pseudo-multi-function device,
|
/* if this is a pseudo-multi-function device,
|
||||||
* we need explicit matches */
|
* we need explicit matches */
|
||||||
if (dev->socket->pcmcia_state.has_pfc)
|
if (dev->socket->pcmcia_pfc)
|
||||||
return 0;
|
return 0;
|
||||||
if (dev->device_no)
|
if (dev->device_no)
|
||||||
return 0;
|
return 0;
|
||||||
@ -1226,7 +1226,7 @@ static int pcmcia_bus_add(struct pcmcia_socket *skt)
|
|||||||
atomic_set(&skt->present, 1);
|
atomic_set(&skt->present, 1);
|
||||||
|
|
||||||
mutex_lock(&skt->ops_mutex);
|
mutex_lock(&skt->ops_mutex);
|
||||||
skt->pcmcia_state.has_pfc = 0;
|
skt->pcmcia_pfc = 0;
|
||||||
destroy_cis_cache(skt); /* to be on the safe side... */
|
destroy_cis_cache(skt); /* to be on the safe side... */
|
||||||
mutex_unlock(&skt->ops_mutex);
|
mutex_unlock(&skt->ops_mutex);
|
||||||
|
|
||||||
@ -1317,7 +1317,7 @@ static int __devinit pcmcia_bus_add_socket(struct device *dev,
|
|||||||
}
|
}
|
||||||
|
|
||||||
INIT_LIST_HEAD(&socket->devices_list);
|
INIT_LIST_HEAD(&socket->devices_list);
|
||||||
memset(&socket->pcmcia_state, 0, sizeof(u8));
|
socket->pcmcia_pfc = 0;
|
||||||
socket->device_count = 0;
|
socket->device_count = 0;
|
||||||
atomic_set(&socket->present, 0);
|
atomic_set(&socket->present, 0);
|
||||||
|
|
||||||
|
@ -1113,8 +1113,6 @@ static ssize_t store_io_db(struct device *dev,
|
|||||||
|
|
||||||
mutex_lock(&s->ops_mutex);
|
mutex_lock(&s->ops_mutex);
|
||||||
ret = adjust_io(s, add, start_addr, end_addr);
|
ret = adjust_io(s, add, start_addr, end_addr);
|
||||||
if (!ret)
|
|
||||||
s->resource_setup_new = 1;
|
|
||||||
mutex_unlock(&s->ops_mutex);
|
mutex_unlock(&s->ops_mutex);
|
||||||
|
|
||||||
return ret ? ret : count;
|
return ret ? ret : count;
|
||||||
@ -1181,8 +1179,6 @@ static ssize_t store_mem_db(struct device *dev,
|
|||||||
|
|
||||||
mutex_lock(&s->ops_mutex);
|
mutex_lock(&s->ops_mutex);
|
||||||
ret = adjust_memory(s, add, start_addr, end_addr);
|
ret = adjust_memory(s, add, start_addr, end_addr);
|
||||||
if (!ret)
|
|
||||||
s->resource_setup_new = 1;
|
|
||||||
mutex_unlock(&s->ops_mutex);
|
mutex_unlock(&s->ops_mutex);
|
||||||
|
|
||||||
return ret ? ret : count;
|
return ret ? ret : count;
|
||||||
|
@ -162,17 +162,10 @@ struct pcmcia_socket {
|
|||||||
u_int pci_irq;
|
u_int pci_irq;
|
||||||
struct pci_dev *cb_dev;
|
struct pci_dev *cb_dev;
|
||||||
|
|
||||||
|
|
||||||
/* socket setup is done so resources should be able to be allocated.
|
/* socket setup is done so resources should be able to be allocated.
|
||||||
* Only if set to 1, calls to find_{io,mem}_region are handled, and
|
* Only if set to 1, calls to find_{io,mem}_region are handled, and
|
||||||
* insertio events are actually managed by the PCMCIA layer.*/
|
* insertio events are actually managed by the PCMCIA layer.*/
|
||||||
u8 resource_setup_done:1;
|
u8 resource_setup_done;
|
||||||
|
|
||||||
/* It's old if resource setup is done using adjust_resource_info() */
|
|
||||||
u8 resource_setup_old:1;
|
|
||||||
u8 resource_setup_new:1;
|
|
||||||
|
|
||||||
u8 reserved:5;
|
|
||||||
|
|
||||||
/* socket operations */
|
/* socket operations */
|
||||||
struct pccard_operations *ops;
|
struct pccard_operations *ops;
|
||||||
@ -218,13 +211,8 @@ struct pcmcia_socket {
|
|||||||
* incorrectness and change */
|
* incorrectness and change */
|
||||||
u8 device_count;
|
u8 device_count;
|
||||||
|
|
||||||
/* 16-bit state: */
|
/* does the PCMCIA card consist of two pseudo devices? */
|
||||||
struct {
|
u8 pcmcia_pfc;
|
||||||
/* the PCMCIA card consists of two pseudo devices */
|
|
||||||
u8 has_pfc:1;
|
|
||||||
|
|
||||||
u8 reserved:7;
|
|
||||||
} pcmcia_state;
|
|
||||||
|
|
||||||
/* non-zero if PCMCIA card is present */
|
/* non-zero if PCMCIA card is present */
|
||||||
atomic_t present;
|
atomic_t present;
|
||||||
|
Loading…
Reference in New Issue
Block a user