Skip to content

Commit d0b8e39

Browse files
committed
ACPI: glue: Eliminate acpi_platform_notify()
Get rid of acpi_platform_notify() which is redundant and make device_platform_notify() in the driver core call acpi_device_notify() and acpi_device_notify_remove() directly. No functional impact. Signed-off-by: Rafael J. Wysocki <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]>
1 parent 5e557cb commit d0b8e39

File tree

3 files changed

+10
-26
lines changed

3 files changed

+10
-26
lines changed

drivers/acpi/glue.c

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ int acpi_unbind_one(struct device *dev)
285285
}
286286
EXPORT_SYMBOL_GPL(acpi_unbind_one);
287287

288-
static void acpi_device_notify(struct device *dev)
288+
void acpi_device_notify(struct device *dev)
289289
{
290290
struct acpi_bus_type *type = acpi_get_bus_type(dev);
291291
struct acpi_device *adev;
@@ -324,7 +324,7 @@ static void acpi_device_notify(struct device *dev)
324324
dev_dbg(dev, "No ACPI support\n");
325325
}
326326

327-
static void acpi_device_notify_remove(struct device *dev)
327+
void acpi_device_notify_remove(struct device *dev)
328328
{
329329
struct acpi_device *adev = ACPI_COMPANION(dev);
330330
struct acpi_bus_type *type;
@@ -340,18 +340,3 @@ static void acpi_device_notify_remove(struct device *dev)
340340

341341
acpi_unbind_one(dev);
342342
}
343-
344-
int acpi_platform_notify(struct device *dev, enum kobject_action action)
345-
{
346-
switch (action) {
347-
case KOBJ_ADD:
348-
acpi_device_notify(dev);
349-
break;
350-
case KOBJ_REMOVE:
351-
acpi_device_notify_remove(dev);
352-
break;
353-
default:
354-
break;
355-
}
356-
return 0;
357-
}

drivers/base/core.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2005,9 +2005,10 @@ device_platform_notify(struct device *dev, enum kobject_action action)
20052005
{
20062006
int ret;
20072007

2008-
ret = acpi_platform_notify(dev, action);
2009-
if (ret)
2010-
return ret;
2008+
if (action == KOBJ_ADD)
2009+
acpi_device_notify(dev);
2010+
else if (action == KOBJ_REMOVE)
2011+
acpi_device_notify_remove(dev);
20112012

20122013
ret = software_node_notify(dev, action);
20132014
if (ret)

include/linux/acpi.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1380,13 +1380,11 @@ static inline int find_acpi_cpu_cache_topology(unsigned int cpu, int level)
13801380
#endif
13811381

13821382
#ifdef CONFIG_ACPI
1383-
extern int acpi_platform_notify(struct device *dev, enum kobject_action action);
1383+
extern void acpi_device_notify(struct device *dev);
1384+
extern void acpi_device_notify_remove(struct device *dev);
13841385
#else
1385-
static inline int
1386-
acpi_platform_notify(struct device *dev, enum kobject_action action)
1387-
{
1388-
return 0;
1389-
}
1386+
static inline void acpi_device_notify(struct device *dev) { }
1387+
static inline void acpi_device_notify_remove(struct device *dev) { }
13901388
#endif
13911389

13921390
#endif /*_LINUX_ACPI_H*/

0 commit comments

Comments
 (0)