CS_BAD_HANDLE means that something went badly wrong: no parameter was passed,
or the paramater passed wasn't the correct one. Therefore, replace it with
-EINVAL.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
int pccard_get_first_tuple(struct pcmcia_socket *s, unsigned int function, tuple_t *tuple)
{
if (!s)
int pccard_get_first_tuple(struct pcmcia_socket *s, unsigned int function, tuple_t *tuple)
{
if (!s)
if (!(s->state & SOCKET_PRESENT))
return -ENODEV;
tuple->TupleLink = tuple->Flags = 0;
if (!(s->state & SOCKET_PRESENT))
return -ENODEV;
tuple->TupleLink = tuple->Flags = 0;
int ofs, i, attr;
if (!s)
int ofs, i, attr;
if (!s)
if (!(s->state & SOCKET_PRESENT))
return -ENODEV;
if (!(s->state & SOCKET_PRESENT))
return -ENODEV;
if (tuple->TupleLink < tuple->TupleOffset)
return CS_NO_MORE_ITEMS;
if (tuple->TupleLink < tuple->TupleOffset)
return CS_NO_MORE_ITEMS;
int ret, reserved, dev_ok = 0, ident_ok = 0;
if (!s)
int ret, reserved, dev_ok = 0, ident_ok = 0;
if (!s)
tuple = kmalloc(sizeof(*tuple), GFP_KERNEL);
if (tuple == NULL) {
tuple = kmalloc(sizeof(*tuple), GFP_KERNEL);
if (tuple == NULL) {
{ CS_IN_USE, "Resource in use" },
{ CS_NO_MORE_ITEMS, "No more items" },
{ CS_OUT_OF_RESOURCE, "Out of resource" },
{ CS_IN_USE, "Resource in use" },
{ CS_NO_MORE_ITEMS, "No more items" },
{ CS_OUT_OF_RESOURCE, "Out of resource" },
- { CS_BAD_HANDLE, "Bad handle" },
{ CS_BAD_TUPLE, "Bad CIS tuple" }
};
{ CS_BAD_TUPLE, "Bad CIS tuple" }
};
int pcmcia_get_mem_page(window_handle_t win, memreq_t *req)
{
if ((win == NULL) || (win->magic != WINDOW_MAGIC))
int pcmcia_get_mem_page(window_handle_t win, memreq_t *req)
{
if ((win == NULL) || (win->magic != WINDOW_MAGIC))
req->Page = 0;
req->CardOffset = win->ctl.card_start;
return 0;
req->Page = 0;
req->CardOffset = win->ctl.card_start;
return 0;
{
struct pcmcia_socket *s;
if ((win == NULL) || (win->magic != WINDOW_MAGIC))
{
struct pcmcia_socket *s;
if ((win == NULL) || (win->magic != WINDOW_MAGIC))
if (req->Page != 0)
return CS_BAD_PAGE;
s = win->sock;
if (req->Page != 0)
return CS_BAD_PAGE;
s = win->sock;
config_t *c = p_dev->function_config;
if (!p_dev->_io )
config_t *c = p_dev->function_config;
if (!p_dev->_io )
config_t *c= p_dev->function_config;
if (!p_dev->_irq)
config_t *c= p_dev->function_config;
if (!p_dev->_irq)
p_dev->_irq = 0;
if (c->state & CONFIG_LOCKED)
p_dev->_irq = 0;
if (c->state & CONFIG_LOCKED)
struct pcmcia_socket *s;
if ((win == NULL) || (win->magic != WINDOW_MAGIC))
struct pcmcia_socket *s;
if ((win == NULL) || (win->magic != WINDOW_MAGIC))
s = win->sock;
if (!(win->handle->_win & CLIENT_WIN_REQ(win->index)))
s = win->sock;
if (!(win->handle->_win & CLIENT_WIN_REQ(win->index)))
/* Shut down memory window */
win->ctl.flags &= ~MAP_ACTIVE;
/* Shut down memory window */
win->ctl.flags &= ~MAP_ACTIVE;
#define CS_IN_USE 0x1e
#define CS_NO_MORE_ITEMS 0x1f
#define CS_OUT_OF_RESOURCE -ENOMEM
#define CS_IN_USE 0x1e
#define CS_NO_MORE_ITEMS 0x1f
#define CS_OUT_OF_RESOURCE -ENOMEM
-#define CS_BAD_HANDLE 0x21
+#define CS_BAD_HANDLE -EINVAL
#define CS_BAD_TUPLE 0x40
#define CS_BAD_TUPLE 0x40