Skip to content

Commit f5c13f1

Browse files
committed
Merge tag 'driver-core-5.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
Pull driver core changes from Greg KH: "Here is the small set of driver core and debugfs updates for 5.14-rc1. Included in here are: - debugfs api cleanups (touched some drivers) - devres updates - tiny driver core updates and tweaks Nothing major in here at all, and all have been in linux-next for a while with no reported issues" * tag 'driver-core-5.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (27 commits) docs: ABI: testing: sysfs-firmware-memmap: add some memmap types. devres: Enable trace events devres: No need to call remove_nodes() when there none present devres: Use list_for_each_safe_from() in remove_nodes() devres: Make locking straight forward in release_nodes() kernfs: move revalidate to be near lookup drivers/base: Constify static attribute_group structs firmware_loader: remove unneeded 'comma' macro devcoredump: remove contact information driver core: Drop helper devm_platform_ioremap_resource_wc() component: Rename 'dev' to 'parent' component: Drop 'dev' argument to component_match_realloc() device property: Don't check for NULL twice in the loops driver core: auxiliary bus: Fix typo in the docs drivers/base/node.c: make CACHE_ATTR define static DEVICE_ATTR_RO debugfs: remove return value of debugfs_create_ulong() debugfs: remove return value of debugfs_create_bool() scsi: snic: debugfs: remove local storage of debugfs files b43: don't save dentries for debugfs b43legacy: don't save dentries for debugfs ...
2 parents eed0218 + 3b1f941 commit f5c13f1

45 files changed

Lines changed: 304 additions & 361 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Documentation/ABI/testing/sysfs-firmware-memmap

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ Description:
5656
- System RAM
5757
- ACPI Tables
5858
- ACPI Non-volatile Storage
59+
- Unusable memory
60+
- Persistent Memory (legacy)
61+
- Persistent Memory
62+
- Soft Reserved
5963
- reserved
6064

6165
Following shell snippet can be used to display that memory

Documentation/driver-api/auxiliary_bus.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ too complex for a single device to be managed by a monolithic driver
1111
(e.g. Sound Open Firmware), multiple devices might implement a common
1212
intersection of functionality (e.g. NICs + RDMA), or a driver may want to
1313
export an interface for another subsystem to drive (e.g. SIOV Physical Function
14-
export Virtual Function management). A split of the functinoality into child-
14+
export Virtual Function management). A split of the functionality into child-
1515
devices representing sub-domains of functionality makes it possible to
1616
compartmentalize, layer, and distribute domain-specific concerns via a Linux
1717
device-driver model.

Documentation/driver-api/driver-model/devres.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,6 @@ IOMAP
314314
devm_ioremap_resource() : checks resource, requests memory region, ioremaps
315315
devm_ioremap_resource_wc()
316316
devm_platform_ioremap_resource() : calls devm_ioremap_resource() for platform device
317-
devm_platform_ioremap_resource_wc()
318317
devm_platform_ioremap_resource_byname()
319318
devm_platform_get_and_ioremap_resource()
320319
devm_iounmap()

Documentation/filesystems/debugfs.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ and hexadecimal::
120120

121121
Boolean values can be placed in debugfs with::
122122

123-
struct dentry *debugfs_create_bool(const char *name, umode_t mode,
124-
struct dentry *parent, bool *value);
123+
void debugfs_create_bool(const char *name, umode_t mode,
124+
struct dentry *parent, bool *value);
125125

126126
A read on the resulting file will yield either Y (for non-zero values) or
127127
N, followed by a newline. If written to, it will accept either upper- or

drivers/base/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,6 @@ obj-y += test/
3030

3131
ccflags-$(CONFIG_DEBUG_DRIVER) := -DDEBUG
3232

33+
# define_trace.h needs to know how to find our header
34+
CFLAGS_trace.o := -I$(src)
35+
obj-$(CONFIG_TRACING) += trace.o

drivers/base/attribute_container.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,8 @@ do_attribute_container_device_trigger_safe(struct device *dev,
284284
* matching classdev or fail all of them.
285285
*
286286
* @dev: The generic device to run the trigger for
287-
* @fn the function to execute for each classdev.
288-
* @undo A function to undo the work previously done in case of error
287+
* @fn: the function to execute for each classdev.
288+
* @undo: A function to undo the work previously done in case of error
289289
*
290290
* This function is a safe version of
291291
* attribute_container_device_trigger. It stops on the first error and
@@ -343,7 +343,7 @@ attribute_container_device_trigger_safe(struct device *dev,
343343
* attribute_container_device_trigger - execute a trigger for each matching classdev
344344
*
345345
* @dev: The generic device to run the trigger for
346-
* @fn the function to execute for each classdev.
346+
* @fn: the function to execute for each classdev.
347347
*
348348
* This function is for executing a trigger when you need to know both
349349
* the container and the classdev. If you only care about the

drivers/base/component.c

Lines changed: 45 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ struct master {
6363
bool bound;
6464

6565
const struct component_master_ops *ops;
66-
struct device *dev;
66+
struct device *parent;
6767
struct component_match *match;
6868
};
6969

@@ -95,7 +95,7 @@ static int component_devices_show(struct seq_file *s, void *data)
9595
seq_printf(s, "%-40s %20s\n", "master name", "status");
9696
seq_puts(s, "-------------------------------------------------------------\n");
9797
seq_printf(s, "%-40s %20s\n\n",
98-
dev_name(m->dev), m->bound ? "bound" : "not bound");
98+
dev_name(m->parent), m->bound ? "bound" : "not bound");
9999

100100
seq_printf(s, "%-40s %20s\n", "device name", "status");
101101
seq_puts(s, "-------------------------------------------------------------\n");
@@ -124,13 +124,13 @@ core_initcall(component_debug_init);
124124

125125
static void component_master_debugfs_add(struct master *m)
126126
{
127-
debugfs_create_file(dev_name(m->dev), 0444, component_debugfs_dir, m,
127+
debugfs_create_file(dev_name(m->parent), 0444, component_debugfs_dir, m,
128128
&component_devices_fops);
129129
}
130130

131131
static void component_master_debugfs_del(struct master *m)
132132
{
133-
debugfs_remove(debugfs_lookup(dev_name(m->dev), component_debugfs_dir));
133+
debugfs_remove(debugfs_lookup(dev_name(m->parent), component_debugfs_dir));
134134
}
135135

136136
#else
@@ -143,13 +143,13 @@ static void component_master_debugfs_del(struct master *m)
143143

144144
#endif
145145

146-
static struct master *__master_find(struct device *dev,
146+
static struct master *__master_find(struct device *parent,
147147
const struct component_master_ops *ops)
148148
{
149149
struct master *m;
150150

151151
list_for_each_entry(m, &masters, node)
152-
if (m->dev == dev && (!ops || m->ops == ops))
152+
if (m->parent == parent && (!ops || m->ops == ops))
153153
return m;
154154

155155
return NULL;
@@ -189,7 +189,7 @@ static int find_components(struct master *master)
189189
struct component_match_array *mc = &match->compare[i];
190190
struct component *c;
191191

192-
dev_dbg(master->dev, "Looking for component %zu\n", i);
192+
dev_dbg(master->parent, "Looking for component %zu\n", i);
193193

194194
if (match->compare[i].component)
195195
continue;
@@ -200,7 +200,7 @@ static int find_components(struct master *master)
200200
break;
201201
}
202202

203-
dev_dbg(master->dev, "found component %s, duplicate %u\n", dev_name(c->dev), !!c->master);
203+
dev_dbg(master->parent, "found component %s, duplicate %u\n", dev_name(c->dev), !!c->master);
204204

205205
/* Attach this component to the master */
206206
match->compare[i].duplicate = !!c->master;
@@ -233,28 +233,28 @@ static int try_to_bring_up_master(struct master *master,
233233
{
234234
int ret;
235235

236-
dev_dbg(master->dev, "trying to bring up master\n");
236+
dev_dbg(master->parent, "trying to bring up master\n");
237237

238238
if (find_components(master)) {
239-
dev_dbg(master->dev, "master has incomplete components\n");
239+
dev_dbg(master->parent, "master has incomplete components\n");
240240
return 0;
241241
}
242242

243243
if (component && component->master != master) {
244-
dev_dbg(master->dev, "master is not for this component (%s)\n",
244+
dev_dbg(master->parent, "master is not for this component (%s)\n",
245245
dev_name(component->dev));
246246
return 0;
247247
}
248248

249-
if (!devres_open_group(master->dev, NULL, GFP_KERNEL))
249+
if (!devres_open_group(master->parent, NULL, GFP_KERNEL))
250250
return -ENOMEM;
251251

252252
/* Found all components */
253-
ret = master->ops->bind(master->dev);
253+
ret = master->ops->bind(master->parent);
254254
if (ret < 0) {
255-
devres_release_group(master->dev, NULL);
255+
devres_release_group(master->parent, NULL);
256256
if (ret != -EPROBE_DEFER)
257-
dev_info(master->dev, "master bind failed: %d\n", ret);
257+
dev_info(master->parent, "master bind failed: %d\n", ret);
258258
return ret;
259259
}
260260

@@ -281,34 +281,28 @@ static int try_to_bring_up_masters(struct component *component)
281281
static void take_down_master(struct master *master)
282282
{
283283
if (master->bound) {
284-
master->ops->unbind(master->dev);
285-
devres_release_group(master->dev, NULL);
284+
master->ops->unbind(master->parent);
285+
devres_release_group(master->parent, NULL);
286286
master->bound = false;
287287
}
288288
}
289289

290-
static void component_match_release(struct device *master,
291-
struct component_match *match)
290+
static void devm_component_match_release(struct device *parent, void *res)
292291
{
292+
struct component_match *match = res;
293293
unsigned int i;
294294

295295
for (i = 0; i < match->num; i++) {
296296
struct component_match_array *mc = &match->compare[i];
297297

298298
if (mc->release)
299-
mc->release(master, mc->data);
299+
mc->release(parent, mc->data);
300300
}
301301

302302
kfree(match->compare);
303303
}
304304

305-
static void devm_component_match_release(struct device *dev, void *res)
306-
{
307-
component_match_release(dev, res);
308-
}
309-
310-
static int component_match_realloc(struct device *dev,
311-
struct component_match *match, size_t num)
305+
static int component_match_realloc(struct component_match *match, size_t num)
312306
{
313307
struct component_match_array *new;
314308

@@ -359,7 +353,7 @@ static void __component_match_add(struct device *master,
359353
size_t new_size = match->alloc + 16;
360354
int ret;
361355

362-
ret = component_match_realloc(master, match, new_size);
356+
ret = component_match_realloc(match, new_size);
363357
if (ret) {
364358
*matchptr = ERR_PTR(ret);
365359
return;
@@ -451,7 +445,7 @@ static void free_master(struct master *master)
451445

452446
/**
453447
* component_master_add_with_match - register an aggregate driver
454-
* @dev: device with the aggregate driver
448+
* @parent: parent device of the aggregate driver
455449
* @ops: callbacks for the aggregate driver
456450
* @match: component match list for the aggregate driver
457451
*
@@ -461,23 +455,23 @@ static void free_master(struct master *master)
461455
* &component_master_ops.bind from @ops. Must be unregistered by calling
462456
* component_master_del().
463457
*/
464-
int component_master_add_with_match(struct device *dev,
458+
int component_master_add_with_match(struct device *parent,
465459
const struct component_master_ops *ops,
466460
struct component_match *match)
467461
{
468462
struct master *master;
469463
int ret;
470464

471465
/* Reallocate the match array for its true size */
472-
ret = component_match_realloc(dev, match, match->num);
466+
ret = component_match_realloc(match, match->num);
473467
if (ret)
474468
return ret;
475469

476470
master = kzalloc(sizeof(*master), GFP_KERNEL);
477471
if (!master)
478472
return -ENOMEM;
479473

480-
master->dev = dev;
474+
master->parent = parent;
481475
master->ops = ops;
482476
master->match = match;
483477

@@ -499,20 +493,20 @@ EXPORT_SYMBOL_GPL(component_master_add_with_match);
499493

500494
/**
501495
* component_master_del - unregister an aggregate driver
502-
* @dev: device with the aggregate driver
496+
* @parent: parent device of the aggregate driver
503497
* @ops: callbacks for the aggregate driver
504498
*
505499
* Unregisters an aggregate driver registered with
506500
* component_master_add_with_match(). If necessary the aggregate driver is first
507501
* disassembled by calling &component_master_ops.unbind from @ops.
508502
*/
509-
void component_master_del(struct device *dev,
503+
void component_master_del(struct device *parent,
510504
const struct component_master_ops *ops)
511505
{
512506
struct master *master;
513507

514508
mutex_lock(&component_mutex);
515-
master = __master_find(dev, ops);
509+
master = __master_find(parent, ops);
516510
if (master) {
517511
take_down_master(master);
518512
free_master(master);
@@ -527,7 +521,7 @@ static void component_unbind(struct component *component,
527521
WARN_ON(!component->bound);
528522

529523
if (component->ops && component->ops->unbind)
530-
component->ops->unbind(component->dev, master->dev, data);
524+
component->ops->unbind(component->dev, master->parent, data);
531525
component->bound = false;
532526

533527
/* Release all resources claimed in the binding of this component */
@@ -536,22 +530,22 @@ static void component_unbind(struct component *component,
536530

537531
/**
538532
* component_unbind_all - unbind all components of an aggregate driver
539-
* @master_dev: device with the aggregate driver
533+
* @parent: parent device of the aggregate driver
540534
* @data: opaque pointer, passed to all components
541535
*
542-
* Unbinds all components of the aggregate @dev by passing @data to their
536+
* Unbinds all components of the aggregate device by passing @data to their
543537
* &component_ops.unbind functions. Should be called from
544538
* &component_master_ops.unbind.
545539
*/
546-
void component_unbind_all(struct device *master_dev, void *data)
540+
void component_unbind_all(struct device *parent, void *data)
547541
{
548542
struct master *master;
549543
struct component *c;
550544
size_t i;
551545

552546
WARN_ON(!mutex_is_locked(&component_mutex));
553547

554-
master = __master_find(master_dev, NULL);
548+
master = __master_find(parent, NULL);
555549
if (!master)
556550
return;
557551

@@ -574,7 +568,7 @@ static int component_bind(struct component *component, struct master *master,
574568
* This allows us to roll-back a failed component without
575569
* affecting anything else.
576570
*/
577-
if (!devres_open_group(master->dev, NULL, GFP_KERNEL))
571+
if (!devres_open_group(master->parent, NULL, GFP_KERNEL))
578572
return -ENOMEM;
579573

580574
/*
@@ -583,14 +577,14 @@ static int component_bind(struct component *component, struct master *master,
583577
* at the appropriate moment.
584578
*/
585579
if (!devres_open_group(component->dev, component, GFP_KERNEL)) {
586-
devres_release_group(master->dev, NULL);
580+
devres_release_group(master->parent, NULL);
587581
return -ENOMEM;
588582
}
589583

590-
dev_dbg(master->dev, "binding %s (ops %ps)\n",
584+
dev_dbg(master->parent, "binding %s (ops %ps)\n",
591585
dev_name(component->dev), component->ops);
592586

593-
ret = component->ops->bind(component->dev, master->dev, data);
587+
ret = component->ops->bind(component->dev, master->parent, data);
594588
if (!ret) {
595589
component->bound = true;
596590

@@ -601,16 +595,16 @@ static int component_bind(struct component *component, struct master *master,
601595
* can clean those resources up independently.
602596
*/
603597
devres_close_group(component->dev, NULL);
604-
devres_remove_group(master->dev, NULL);
598+
devres_remove_group(master->parent, NULL);
605599

606-
dev_info(master->dev, "bound %s (ops %ps)\n",
600+
dev_info(master->parent, "bound %s (ops %ps)\n",
607601
dev_name(component->dev), component->ops);
608602
} else {
609603
devres_release_group(component->dev, NULL);
610-
devres_release_group(master->dev, NULL);
604+
devres_release_group(master->parent, NULL);
611605

612606
if (ret != -EPROBE_DEFER)
613-
dev_err(master->dev, "failed to bind %s (ops %ps): %d\n",
607+
dev_err(master->parent, "failed to bind %s (ops %ps): %d\n",
614608
dev_name(component->dev), component->ops, ret);
615609
}
616610

@@ -619,14 +613,14 @@ static int component_bind(struct component *component, struct master *master,
619613

620614
/**
621615
* component_bind_all - bind all components of an aggregate driver
622-
* @master_dev: device with the aggregate driver
616+
* @parent: parent device of the aggregate driver
623617
* @data: opaque pointer, passed to all components
624618
*
625619
* Binds all components of the aggregate @dev by passing @data to their
626620
* &component_ops.bind functions. Should be called from
627621
* &component_master_ops.bind.
628622
*/
629-
int component_bind_all(struct device *master_dev, void *data)
623+
int component_bind_all(struct device *parent, void *data)
630624
{
631625
struct master *master;
632626
struct component *c;
@@ -635,7 +629,7 @@ int component_bind_all(struct device *master_dev, void *data)
635629

636630
WARN_ON(!mutex_is_locked(&component_mutex));
637631

638-
master = __master_find(master_dev, NULL);
632+
master = __master_find(parent, NULL);
639633
if (!master)
640634
return -EINVAL;
641635

drivers/base/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3442,7 +3442,7 @@ bool kill_device(struct device *dev)
34423442
* to run while we are tearing out the bus/class/sysfs from
34433443
* underneath the device.
34443444
*/
3445-
lockdep_assert_held(&dev->mutex);
3445+
device_lock_assert(dev);
34463446

34473447
if (dev->p->dead)
34483448
return false;

0 commit comments

Comments
 (0)