]> git.baikalelectronics.ru Git - kernel.git/commit
device property: Get rid of struct fwnode_handle type field
authorSakari Ailus <sakari.ailus@linux.intel.com>
Fri, 21 Jul 2017 11:39:31 +0000 (14:39 +0300)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 21 Jul 2017 22:04:50 +0000 (00:04 +0200)
commitb881c8cae9eea7a9fcd8ea248b7f16d7fe94b7ac
tree87c3c735dd51f68e77d3189186094ee216204a76
parent546eff4e4b67dd8b43ca7755a1976123c9483ebf
device property: Get rid of struct fwnode_handle type field

Instead of relying on the struct fwnode_handle type field, define
fwnode_operations structs for all separate types of fwnodes. To find out
the type, compare to the ops field to relevant ops structs.

This change has two benefits:

1. it avoids adding the type field to each and every instance of struct
fwnode_handle, thus saving memory and

2. makes the ops field the single factor that defines both the types of
the fwnode as well as defines the implementation of its operations,
decreasing the possibility of bugs when developing code dealing with
fwnode internals.

Suggested-by: Rob Herring <robh@kernel.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/property.c
drivers/acpi/scan.c
drivers/base/property.c
drivers/of/property.c
include/acpi/acpi_bus.h
include/linux/acpi.h
include/linux/fwnode.h
include/linux/irqdomain.h
include/linux/of.h
kernel/irq/irqdomain.c