Skip to content

Commit 4e47e46

Browse files
committed
Merge tag 'pcmcia-6.18' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux
Pull PCMCIA fixes and cleanups from Dominik Brodowski: "A number of minor PCMCIA bugfixes and cleanups, including the removal of unused code paths" [ Dominik suggested this might be 6.18 material, but having looked through this, it looks appropriate early: minor trivial fixes and then one slightly bigger patch that removes dead code - Linus ] * tag 'pcmcia-6.18' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux: pcmcia: Add error handling for add_interval() in do_validate_mem() pcmcia: cs: Remove unused pcmcia_get_socket_by_nr pcmcia: omap: Add missing check for platform_get_resource pcmcia: Use str_off_on() and str_yes_no() helpers pcmcia: remove PCCARD_IODYN pcmcia: ds: Emphasize "really" epizeuxis pcmcia: Fix a NULL pointer dereference in __iodyn_find_io_region() pcmcia: omap_cf: Mark driver struct with __refdata to prevent section mismatch
2 parents d69eb20 + 4a81f78 commit 4e47e46

File tree

10 files changed

+17
-202
lines changed

10 files changed

+17
-202
lines changed

drivers/pcmcia/Kconfig

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,4 @@ config ELECTRA_CF
250250
config PCCARD_NONSTATIC
251251
bool
252252

253-
config PCCARD_IODYN
254-
bool
255-
256253
endif # PCCARD

drivers/pcmcia/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ obj-$(CONFIG_PCMCIA) += pcmcia.o
1212

1313
pcmcia_rsrc-y += rsrc_mgr.o
1414
pcmcia_rsrc-$(CONFIG_PCCARD_NONSTATIC) += rsrc_nonstatic.o
15-
pcmcia_rsrc-$(CONFIG_PCCARD_IODYN) += rsrc_iodyn.o
1615
obj-$(CONFIG_PCCARD) += pcmcia_rsrc.o
1716

1817

drivers/pcmcia/cs.c

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -229,23 +229,6 @@ void pcmcia_unregister_socket(struct pcmcia_socket *socket)
229229
EXPORT_SYMBOL(pcmcia_unregister_socket);
230230

231231

232-
struct pcmcia_socket *pcmcia_get_socket_by_nr(unsigned int nr)
233-
{
234-
struct pcmcia_socket *s;
235-
236-
down_read(&pcmcia_socket_list_rwsem);
237-
list_for_each_entry(s, &pcmcia_socket_list, socket_list)
238-
if (s->sock == nr) {
239-
up_read(&pcmcia_socket_list_rwsem);
240-
return s;
241-
}
242-
up_read(&pcmcia_socket_list_rwsem);
243-
244-
return NULL;
245-
246-
}
247-
EXPORT_SYMBOL(pcmcia_get_socket_by_nr);
248-
249232
static int socket_reset(struct pcmcia_socket *skt)
250233
{
251234
int status, i;

drivers/pcmcia/cs_internal.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ extern struct list_head pcmcia_socket_list;
116116
extern const struct class pcmcia_socket_class;
117117

118118
int pccard_register_pcmcia(struct pcmcia_socket *s, struct pcmcia_callback *c);
119-
struct pcmcia_socket *pcmcia_get_socket_by_nr(unsigned int nr);
120119

121120
void pcmcia_parse_uevents(struct pcmcia_socket *socket, unsigned int events);
122121
#define PCMCIA_UEVENT_EJECT 0x0001

drivers/pcmcia/ds.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1308,7 +1308,7 @@ static int pcmcia_bus_early_resume(struct pcmcia_socket *skt)
13081308
* physically present, even if the call to this function returns
13091309
* non-NULL. Furthermore, the device driver most likely is unbound
13101310
* almost immediately, so the timeframe where pcmcia_dev_present
1311-
* returns NULL is probably really really small.
1311+
* returns NULL is probably really, really small.
13121312
*/
13131313
struct pcmcia_device *pcmcia_dev_present(struct pcmcia_device *_p_dev)
13141314
{

drivers/pcmcia/omap_cf.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,8 @@ static int __init omap_cf_probe(struct platform_device *pdev)
215215
return -EINVAL;
216216

217217
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
218+
if (!res)
219+
return -EINVAL;
218220

219221
cf = kzalloc(sizeof *cf, GFP_KERNEL);
220222
if (!cf)
@@ -302,7 +304,13 @@ static void __exit omap_cf_remove(struct platform_device *pdev)
302304
kfree(cf);
303305
}
304306

305-
static struct platform_driver omap_cf_driver = {
307+
/*
308+
* omap_cf_remove() lives in .exit.text. For drivers registered via
309+
* platform_driver_probe() this is ok because they cannot get unbound at
310+
* runtime. So mark the driver struct with __refdata to prevent modpost
311+
* triggering a section mismatch warning.
312+
*/
313+
static struct platform_driver omap_cf_driver __refdata = {
306314
.driver = {
307315
.name = driver_name,
308316
},

drivers/pcmcia/rsrc_iodyn.c

Lines changed: 0 additions & 168 deletions
This file was deleted.

drivers/pcmcia/rsrc_nonstatic.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,9 @@ static int do_validate_mem(struct pcmcia_socket *s,
375375

376376
if (validate && !s->fake_cis) {
377377
/* move it to the validated data set */
378-
add_interval(&s_data->mem_db_valid, base, size);
378+
ret = add_interval(&s_data->mem_db_valid, base, size);
379+
if (ret)
380+
return ret;
379381
sub_interval(&s_data->mem_db, base, size);
380382
}
381383

drivers/pcmcia/socket_sysfs.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <linux/init.h>
1111
#include <linux/kernel.h>
1212
#include <linux/string.h>
13+
#include <linux/string_choices.h>
1314
#include <linux/major.h>
1415
#include <linux/errno.h>
1516
#include <linux/mm.h>
@@ -98,7 +99,7 @@ static ssize_t pccard_show_card_pm_state(struct device *dev,
9899
char *buf)
99100
{
100101
struct pcmcia_socket *s = to_socket(dev);
101-
return sysfs_emit(buf, "%s\n", s->state & SOCKET_SUSPEND ? "off" : "on");
102+
return sysfs_emit(buf, "%s\n", str_off_on(s->state & SOCKET_SUSPEND));
102103
}
103104

104105
static ssize_t pccard_store_card_pm_state(struct device *dev,
@@ -177,7 +178,7 @@ static ssize_t pccard_show_resource(struct device *dev,
177178
struct device_attribute *attr, char *buf)
178179
{
179180
struct pcmcia_socket *s = to_socket(dev);
180-
return sysfs_emit(buf, "%s\n", s->resource_setup_done ? "yes" : "no");
181+
return sysfs_emit(buf, "%s\n", str_yes_no(s->resource_setup_done));
181182
}
182183

183184
static ssize_t pccard_store_resource(struct device *dev,

include/pcmcia/ss.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -227,26 +227,20 @@ struct pcmcia_socket {
227227

228228

229229
/* socket drivers must define the resource operations type they use. There
230-
* are three options:
230+
* are two options:
231231
* - pccard_static_ops iomem and ioport areas are assigned statically
232-
* - pccard_iodyn_ops iomem areas is assigned statically, ioport
233-
* areas dynamically
234-
* If this option is selected, use
235-
* "select PCCARD_IODYN" in Kconfig.
236232
* - pccard_nonstatic_ops iomem and ioport areas are assigned dynamically.
237233
* If this option is selected, use
238234
* "select PCCARD_NONSTATIC" in Kconfig.
239235
*
240236
*/
241237
extern struct pccard_resource_ops pccard_static_ops;
242238
#if defined(CONFIG_PCMCIA) || defined(CONFIG_PCMCIA_MODULE)
243-
extern struct pccard_resource_ops pccard_iodyn_ops;
244239
extern struct pccard_resource_ops pccard_nonstatic_ops;
245240
#else
246241
/* If PCMCIA is not used, but only CARDBUS, these functions are not used
247242
* at all. Therefore, do not use the large (240K!) rsrc_nonstatic module
248243
*/
249-
#define pccard_iodyn_ops pccard_static_ops
250244
#define pccard_nonstatic_ops pccard_static_ops
251245
#endif
252246

0 commit comments

Comments
 (0)