Skip to content

Commit

Permalink
[PATCH] pcmcia: remove get_socket callback
Browse files Browse the repository at this point in the history
The .get_socket callback is never used by the PCMCIA core, therefore remove
it.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
  • Loading branch information
Dominik Brodowski committed Jan 5, 2006
1 parent 7f316b0 commit 9da4bc6
Show file tree
Hide file tree
Showing 15 changed files with 0 additions and 607 deletions.
18 changes: 0 additions & 18 deletions drivers/pcmcia/au1000_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,23 +241,6 @@ au1x00_pcmcia_get_status(struct pcmcia_socket *sock, unsigned int *status)
return 0;
}

/* au1x00_pcmcia_get_socket()
* Implements the get_socket() operation for the in-kernel PCMCIA
* service (formerly SS_GetSocket in Card Services). Not a very
* exciting routine.
*
* Returns: 0
*/
static int
au1x00_pcmcia_get_socket(struct pcmcia_socket *sock, socket_state_t *state)
{
struct au1000_pcmcia_socket *skt = to_au1000_socket(sock);

debug("for sock %u\n", skt->nr);
*state = skt->cs_state;
return 0;
}

/* au1x00_pcmcia_set_socket()
* Implements the set_socket() operation for the in-kernel PCMCIA
* service (formerly SS_SetSocket in Card Services). We more or
Expand Down Expand Up @@ -352,7 +335,6 @@ static struct pccard_operations au1x00_pcmcia_operations = {
.init = au1x00_pcmcia_sock_init,
.suspend = au1x00_pcmcia_suspend,
.get_status = au1x00_pcmcia_get_status,
.get_socket = au1x00_pcmcia_get_socket,
.set_socket = au1x00_pcmcia_set_socket,
.set_io_map = au1x00_pcmcia_set_io_map,
.set_mem_map = au1x00_pcmcia_set_mem_map,
Expand Down
13 changes: 0 additions & 13 deletions drivers/pcmcia/hd64465_ss.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,18 +417,6 @@ static int hs_get_status(struct pcmcia_socket *s, u_int *value)

/*============================================================*/

static int hs_get_socket(struct pcmcia_socket *s, socket_state_t *state)
{
hs_socket_t *sp = container_of(s, struct hs_socket_t, socket);

DPRINTK("hs_get_socket(%d)\n", sock);

*state = sp->state;
return 0;
}

/*============================================================*/

static int hs_set_socket(struct pcmcia_socket *s, socket_state_t *state)
{
hs_socket_t *sp = container_of(s, struct hs_socket_t, socket);
Expand Down Expand Up @@ -749,7 +737,6 @@ static irqreturn_t hs_interrupt(int irq, void *dev, struct pt_regs *regs)
static struct pccard_operations hs_operations = {
.init = hs_init,
.get_status = hs_get_status,
.get_socket = hs_get_socket,
.set_socket = hs_set_socket,
.set_io_map = hs_set_io_map,
.set_mem_map = hs_set_mem_map,
Expand Down
73 changes: 0 additions & 73 deletions drivers/pcmcia/i82092.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ static struct pci_driver i82092aa_pci_drv = {
static struct pccard_operations i82092aa_operations = {
.init = i82092aa_init,
.get_status = i82092aa_get_status,
.get_socket = i82092aa_get_socket,
.set_socket = i82092aa_set_socket,
.set_io_map = i82092aa_set_io_map,
.set_mem_map = i82092aa_set_mem_map,
Expand Down Expand Up @@ -482,78 +481,6 @@ static int i82092aa_get_status(struct pcmcia_socket *socket, u_int *value)
}


static int i82092aa_get_socket(struct pcmcia_socket *socket, socket_state_t *state)
{
unsigned int sock = container_of(socket, struct socket_info, socket)->number;
unsigned char reg,vcc,vpp;

enter("i82092aa_get_socket");
state->flags = 0;
state->Vcc = 0;
state->Vpp = 0;
state->io_irq = 0;
state->csc_mask = 0;

/* First the power status of the socket */
reg = indirect_read(sock,I365_POWER); /* PCTRL - Power Control Register */

if (reg & I365_PWR_AUTO)
state->flags |= SS_PWR_AUTO; /* Automatic Power Switch */

if (reg & I365_PWR_OUT)
state->flags |= SS_OUTPUT_ENA; /* Output signals are enabled */

vcc = reg & I365_VCC_MASK; vpp = reg & I365_VPP1_MASK;

if (reg & I365_VCC_5V) { /* Can still be 3.3V, in this case the Vcc value will be overwritten later */
state->Vcc = 50;

if (vpp == I365_VPP1_5V)
state->Vpp = 50;
if (vpp == I365_VPP1_12V)
state->Vpp = 120;

}

if ((reg & I365_VCC_3V)==I365_VCC_3V)
state->Vcc = 33;


/* Now the IO card, RESET flags and IO interrupt */

reg = indirect_read(sock, I365_INTCTL); /* IGENC, Interrupt and General Control */

if ((reg & I365_PC_RESET)==0)
state->flags |= SS_RESET;
if (reg & I365_PC_IOCARD)
state->flags |= SS_IOCARD; /* This is an IO card */

/* Set the IRQ number */
if (sockets[sock].dev!=NULL)
state->io_irq = sockets[sock].dev->irq;

/* Card status change */
reg = indirect_read(sock, I365_CSCINT); /* CSCICR, Card Status Change Interrupt Configuration */

if (reg & I365_CSC_DETECT)
state->csc_mask |= SS_DETECT; /* Card detect is enabled */

if (state->flags & SS_IOCARD) {/* IO Cards behave different */
if (reg & I365_CSC_STSCHG)
state->csc_mask |= SS_STSCHG;
} else {
if (reg & I365_CSC_BVD1)
state->csc_mask |= SS_BATDEAD;
if (reg & I365_CSC_BVD2)
state->csc_mask |= SS_BATWARN;
if (reg & I365_CSC_READY)
state->csc_mask |= SS_READY;
}

leave("i82092aa_get_socket");
return 0;
}

static int i82092aa_set_socket(struct pcmcia_socket *socket, socket_state_t *state)
{
unsigned int sock = container_of(socket, struct socket_info, socket)->number;
Expand Down
1 change: 0 additions & 1 deletion drivers/pcmcia/i82092aa.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ static irqreturn_t i82092aa_interrupt(int irq, void *dev, struct pt_regs *regs);


static int i82092aa_get_status(struct pcmcia_socket *socket, u_int *value);
static int i82092aa_get_socket(struct pcmcia_socket *socket, socket_state_t *state);
static int i82092aa_set_socket(struct pcmcia_socket *socket, socket_state_t *state);
static int i82092aa_set_io_map(struct pcmcia_socket *socket, struct pccard_io_map *io);
static int i82092aa_set_mem_map(struct pcmcia_socket *socket, struct pccard_mem_map *mem);
Expand Down
83 changes: 0 additions & 83 deletions drivers/pcmcia/i82365.c
Original file line number Diff line number Diff line change
Expand Up @@ -940,78 +940,6 @@ static int i365_get_status(u_short sock, u_int *value)

/*====================================================================*/

static int i365_get_socket(u_short sock, socket_state_t *state)
{
struct i82365_socket *t = &socket[sock];
u_char reg, vcc, vpp;

reg = i365_get(sock, I365_POWER);
state->flags = (reg & I365_PWR_AUTO) ? SS_PWR_AUTO : 0;
state->flags |= (reg & I365_PWR_OUT) ? SS_OUTPUT_ENA : 0;
vcc = reg & I365_VCC_MASK; vpp = reg & I365_VPP1_MASK;
state->Vcc = state->Vpp = 0;
if (t->flags & IS_CIRRUS) {
if (i365_get(sock, PD67_MISC_CTL_1) & PD67_MC1_VCC_3V) {
if (reg & I365_VCC_5V) state->Vcc = 33;
if (vpp == I365_VPP1_5V) state->Vpp = 33;
} else {
if (reg & I365_VCC_5V) state->Vcc = 50;
if (vpp == I365_VPP1_5V) state->Vpp = 50;
}
if (vpp == I365_VPP1_12V) state->Vpp = 120;
} else if (t->flags & IS_VG_PWR) {
if (i365_get(sock, VG469_VSELECT) & VG469_VSEL_VCC) {
if (reg & I365_VCC_5V) state->Vcc = 33;
if (vpp == I365_VPP1_5V) state->Vpp = 33;
} else {
if (reg & I365_VCC_5V) state->Vcc = 50;
if (vpp == I365_VPP1_5V) state->Vpp = 50;
}
if (vpp == I365_VPP1_12V) state->Vpp = 120;
} else if (t->flags & IS_DF_PWR) {
if (vcc == I365_VCC_3V) state->Vcc = 33;
if (vcc == I365_VCC_5V) state->Vcc = 50;
if (vpp == I365_VPP1_5V) state->Vpp = 50;
if (vpp == I365_VPP1_12V) state->Vpp = 120;
} else {
if (reg & I365_VCC_5V) {
state->Vcc = 50;
if (vpp == I365_VPP1_5V) state->Vpp = 50;
if (vpp == I365_VPP1_12V) state->Vpp = 120;
}
}

/* IO card, RESET flags, IO interrupt */
reg = i365_get(sock, I365_INTCTL);
state->flags |= (reg & I365_PC_RESET) ? 0 : SS_RESET;
if (reg & I365_PC_IOCARD) state->flags |= SS_IOCARD;
state->io_irq = reg & I365_IRQ_MASK;

/* speaker control */
if (t->flags & IS_CIRRUS) {
if (i365_get(sock, PD67_MISC_CTL_1) & PD67_MC1_SPKR_ENA)
state->flags |= SS_SPKR_ENA;
}

/* Card status change mask */
reg = i365_get(sock, I365_CSCINT);
state->csc_mask = (reg & I365_CSC_DETECT) ? SS_DETECT : 0;
if (state->flags & SS_IOCARD)
state->csc_mask |= (reg & I365_CSC_STSCHG) ? SS_STSCHG : 0;
else {
state->csc_mask |= (reg & I365_CSC_BVD1) ? SS_BATDEAD : 0;
state->csc_mask |= (reg & I365_CSC_BVD2) ? SS_BATWARN : 0;
state->csc_mask |= (reg & I365_CSC_READY) ? SS_READY : 0;
}

debug(1, "GetSocket(%d) = flags %#3.3x, Vcc %d, Vpp %d, "
"io_irq %d, csc_mask %#2.2x\n", sock, state->flags,
state->Vcc, state->Vpp, state->io_irq, state->csc_mask);
return 0;
} /* i365_get_socket */

/*====================================================================*/

static int i365_set_socket(u_short sock, socket_state_t *state)
{
struct i82365_socket *t = &socket[sock];
Expand Down Expand Up @@ -1265,16 +1193,6 @@ static int pcic_get_status(struct pcmcia_socket *s, u_int *value)
LOCKED(i365_get_status(sock, value));
}

static int pcic_get_socket(struct pcmcia_socket *s, socket_state_t *state)
{
unsigned int sock = container_of(s, struct i82365_socket, socket)->number;

if (socket[sock].flags & IS_ALIVE)
return -EINVAL;

LOCKED(i365_get_socket(sock, state));
}

static int pcic_set_socket(struct pcmcia_socket *s, socket_state_t *state)
{
unsigned int sock = container_of(s, struct i82365_socket, socket)->number;
Expand Down Expand Up @@ -1324,7 +1242,6 @@ static int pcic_init(struct pcmcia_socket *s)
static struct pccard_operations pcic_operations = {
.init = pcic_init,
.get_status = pcic_get_status,
.get_socket = pcic_get_socket,
.set_socket = pcic_set_socket,
.set_io_map = pcic_set_io_map,
.set_mem_map = pcic_set_mem_map,
Expand Down
32 changes: 0 additions & 32 deletions drivers/pcmcia/m32r_cfc.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,25 +480,6 @@ static int _pcc_get_status(u_short sock, u_int *value)

/*====================================================================*/

static int _pcc_get_socket(u_short sock, socket_state_t *state)
{
// pcc_socket_t *t = &socket[sock];

state->flags = 0;
state->csc_mask = SS_DETECT;
state->csc_mask |= SS_READY;
state->io_irq = 0;
state->Vcc = 33; /* 3.3V fixed */
state->Vpp = 33;

debug(3, "m32r_cfc: GetSocket(%d) = flags %#3.3x, Vcc %d, Vpp %d, "
"io_irq %d, csc_mask %#2.2x\n", sock, state->flags,
state->Vcc, state->Vpp, state->io_irq, state->csc_mask);
return 0;
} /* _get_socket */

/*====================================================================*/

static int _pcc_set_socket(u_short sock, socket_state_t *state)
{
debug(3, "m32r_cfc: SetSocket(%d, flags %#3.3x, Vcc %d, Vpp %d, "
Expand Down Expand Up @@ -667,18 +648,6 @@ static int pcc_get_status(struct pcmcia_socket *s, u_int *value)
LOCKED(_pcc_get_status(sock, value));
}

static int pcc_get_socket(struct pcmcia_socket *s, socket_state_t *state)
{
unsigned int sock = container_of(s, struct pcc_socket, socket)->number;

if (socket[sock].flags & IS_ALIVE) {
debug(3, "m32r_cfc: pcc_get_socket: sock(%d) -EINVAL\n", sock);
return -EINVAL;
}
debug(3, "m32r_cfc: pcc_get_socket: sock(%d)\n", sock);
LOCKED(_pcc_get_socket(sock, state));
}

static int pcc_set_socket(struct pcmcia_socket *s, socket_state_t *state)
{
unsigned int sock = container_of(s, struct pcc_socket, socket)->number;
Expand Down Expand Up @@ -724,7 +693,6 @@ static int pcc_init(struct pcmcia_socket *s)
static struct pccard_operations pcc_operations = {
.init = pcc_init,
.get_status = pcc_get_status,
.get_socket = pcc_get_socket,
.set_socket = pcc_set_socket,
.set_io_map = pcc_set_io_map,
.set_mem_map = pcc_set_mem_map,
Expand Down
20 changes: 0 additions & 20 deletions drivers/pcmcia/m32r_pcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,16 +429,6 @@ static int _pcc_get_status(u_short sock, u_int *value)

/*====================================================================*/

static int _pcc_get_socket(u_short sock, socket_state_t *state)
{
debug(3, "m32r-pcc: GetSocket(%d) = flags %#3.3x, Vcc %d, Vpp %d, "
"io_irq %d, csc_mask %#2.2x\n", sock, state->flags,
state->Vcc, state->Vpp, state->io_irq, state->csc_mask);
return 0;
} /* _get_socket */

/*====================================================================*/

static int _pcc_set_socket(u_short sock, socket_state_t *state)
{
u_long reg = 0;
Expand Down Expand Up @@ -641,15 +631,6 @@ static int pcc_get_status(struct pcmcia_socket *s, u_int *value)
LOCKED(_pcc_get_status(sock, value));
}

static int pcc_get_socket(struct pcmcia_socket *s, socket_state_t *state)
{
unsigned int sock = container_of(s, struct pcc_socket, socket)->number;

if (socket[sock].flags & IS_ALIVE)
return -EINVAL;
LOCKED(_pcc_get_socket(sock, state));
}

static int pcc_set_socket(struct pcmcia_socket *s, socket_state_t *state)
{
unsigned int sock = container_of(s, struct pcc_socket, socket)->number;
Expand Down Expand Up @@ -687,7 +668,6 @@ static int pcc_init(struct pcmcia_socket *s)
static struct pccard_operations pcc_operations = {
.init = pcc_init,
.get_status = pcc_get_status,
.get_socket = pcc_get_socket,
.set_socket = pcc_set_socket,
.set_io_map = pcc_set_io_map,
.set_mem_map = pcc_set_mem_map,
Expand Down
12 changes: 0 additions & 12 deletions drivers/pcmcia/m8xx_pcmcia.c
Original file line number Diff line number Diff line change
Expand Up @@ -823,17 +823,6 @@ static int m8xx_get_status(struct pcmcia_socket *sock, unsigned int *value)
return 0;
}

static int m8xx_get_socket(struct pcmcia_socket *sock, socket_state_t *state)
{
int lsock = container_of(sock, struct socket_info, socket)->slot;
*state = socket[lsock].state; /* copy the whole structure */

dprintk("GetSocket(%d) = flags %#3.3x, Vcc %d, Vpp %d, "
"io_irq %d, csc_mask %#2.2x\n", lsock, state->flags,
state->Vcc, state->Vpp, state->io_irq, state->csc_mask);
return 0;
}

static int m8xx_set_socket(struct pcmcia_socket *sock, socket_state_t *state)
{
int lsock = container_of(sock, struct socket_info, socket)->slot;
Expand Down Expand Up @@ -1169,7 +1158,6 @@ static struct pccard_operations m8xx_services = {
.init = m8xx_sock_init,
.suspend = m8xx_suspend,
.get_status = m8xx_get_status,
.get_socket = m8xx_get_socket,
.set_socket = m8xx_set_socket,
.set_io_map = m8xx_set_io_map,
.set_mem_map = m8xx_set_mem_map,
Expand Down
Loading

0 comments on commit 9da4bc6

Please sign in to comment.