Cleanups for ACPI APD driver
v2 cover Cleanups for ACPI APD driver
ACPI APD driver has some unused code and some mis-behaved kernel doc, make a cleanup for this driver.
Tested on Hisilicon ARM64, and compile tested on Intel x86.
v1->v2:
- Fix the compile warning reported by kernel test robot.
Hanjun Guo (5):
ACPI / APD: Add kernel doc for the properties in struct
apd_device_desc
ACPI / APD: Remove the flags in struct apd_device_desc ACPI / APD: Remove ACPI_MODULE_NAME()
ACPI / APD: Remove the unneeded APD_ADDR(desc) macro define ACPI / APD: Head file including cleanups
drivers/acpi/acpi_apd.c | 34 ++++++++-------------------------- 1 file changed, 8 insertions(+), 26 deletions(-)
Signature · 1 line
1.7.12.4
PATCH v2 1/5 ACPI / APD: Add kernel doc for the properties in struct apd_device_desc
commit 7ff55d174cbf ("ACPI / APD: Provide build-in properties of the UART") add the 'struct property_entry *properties' in struct apd_device_desc but didn't add the kernel doc, add it now.
--- drivers/acpi/acpi_apd.c | 1 + 1 file changed, 1 insertion(+)
drivers/acpi/acpi_apd.c +1 -0
@@ -34,6 +34,7 @@* @flags: device flags like %ACPI_APD_SYSFS, %ACPI_APD_PM * @fixed_clk_rate: fixed rate input clock source for acpi device; * 0 means no fixed rate input clock source +* @properties: build-in properties of the device such as UART * @setup: a hook routine to set device resource during create platform device * * Device description defined as acpi_device_id.driver_data
Signature · 1 line
1.7.12.4
PATCH v2 2/5 ACPI / APD: Remove the flags in struct apd_device_desc
In reply to Hanjun GuoThe flags is not used in anywhere, remove it and its related code.
--- drivers/acpi/acpi_apd.c | 9 --------- 1 file changed, 9 deletions(-)
drivers/acpi/acpi_apd.c +0 -9
@@ -23,15 +23,7 @@struct apd_private_data ;/** -* ACPI_APD_SYSFS : add device attributes in sysfs -* ACPI_APD_PM : attach power domain to device -*/ -#define ACPI_APD_SYSFS BIT(0) -#define ACPI_APD_PM BIT(1) - -/** * struct apd_device_desc - a descriptor for apd device -* @flags: device flags like %ACPI_APD_SYSFS, %ACPI_APD_PM * @fixed_clk_rate: fixed rate input clock source for acpi device; * 0 means no fixed rate input clock source * @properties: build-in properties of the device such as UART
@@ -40,7 +32,6 @@* Device description defined as acpi_device_id.driver_data */ struct apd_device_desc { -unsigned int flags;unsigned int fixed_clk_rate;struct property_entry *properties;int (*setup)(struct apd_private_data *pdata);
Signature · 1 line
1.7.12.4
PATCH v2 3/5 ACPI / APD: Remove ACPI_MODULE_NAME()
In reply to Hanjun GuoACPI_MODULE_NAME() is used for ACPI debug output when using ACPI debug print functions, but ACPI debug print functions are not used in acpi_apd.c, remove the ACPI_MODULE_NAME().
--- drivers/acpi/acpi_apd.c | 1 - 1 file changed, 1 deletion(-)
drivers/acpi/acpi_apd.c +0 -1
@@ -19,7 +19,6 @@#include "internal.h" -ACPI_MODULE_NAME ("acpi_apd" );struct apd_private_data ;/**
Signature · 1 line
1.7.12.4
PATCH v2 4/5 ACPI / APD: Remove the unneeded APD_ADDR(desc) macro define
In reply to Hanjun GuoSince APD_ADDR(desc) is only used when CONFIG_X86_AMD_PLATFORM_DEVICE or CONFIG_ARM64 is set, no need for the redundant
'#define APD_ADDR(desc) (0UL)', remove it.
Also update the comments for #endif.
--- drivers/acpi/acpi_apd.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
drivers/acpi/acpi_apd.c +3 -8
@@ -62,7 +62,6 @@ static int acpi_apd_setup(struct apd_private_data *pdata) }#ifdef CONFIG_X86_AMD_PLATFORM_DEVICE -static int misc_check_res (struct acpi_resource *ares,void *data) {struct resource res;
@@ -133,7 +132,7 @@ static int fch_misc_setup(struct apd_private_data *pdata)static const struct apd_device_desc fch_misc_desc = { .setup = fch_misc_setup, }; -#endif +#endif /* CONFIG_X86_AMD_PLATFORM_DEVICE */ #ifdef CONFIG_ARM64 static const struct apd_device_desc xgene_i2c_desc = {
@@ -175,13 +174,9 @@ static int fch_misc_setup(struct apd_private_data *pdata) .setup = acpi_apd_setup, .fixed_clk_rate = 250000000, }; -#endif +#endif /* CONFIG_ARM64 */ -#else - -#define APD_ADDR (desc) (0UL) - -#endif /* CONFIG_X86_AMD_PLATFORM_DEVICE */ +#endif /** * Create platform device during acpi scan attach handle.
Signature · 1 line
1.7.12.4
PATCH v2 5/5 ACPI / APD: Head file including cleanups
In reply to Hanjun GuoMake the including head files to be alphabetical order, and remove the not needed head file inclusion.
--- drivers/acpi/acpi_apd.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/acpi/acpi_apd.c +4 -6
@@ -7,15 +7,13 @@* Wu, Jeff <[email protected]> */ -#include <linux/clk-provider.h> -#include <linux/platform_data/clk-fch.h> -#include <linux/platform_device.h> -#include <linux/pm_domain.h> -#include <linux/clkdev.h> #include <linux/acpi.h> +#include <linux/clkdev.h> +#include <linux/clk-provider.h> #include <linux/err.h> #include <linux/io.h> -#include <linux/pm.h> +#include <linux/platform_data/clk-fch.h> +#include <linux/platform_device.h> #include "internal.h"
Signature · 1 line
1.7.12.4
Rafael J. Wysocki
maintainerQuoted 9 lines · Hanjun Guo
ACPI APD driver has some unused code and some mis-behaved kernel doc, make a cleanup for this driver.
Tested on Hisilicon ARM64, and compile tested on Intel x86.
v1->v2:
- Fix the compile warning reported by kernel test robot.
Quoted 7 lines
Hanjun Guo (5):
ACPI / APD: Add kernel doc for the properties in struct
apd_device_desc
ACPI / APD: Remove the flags in structapd_device_descACPI / APD: RemoveACPI_MODULE_NAME()
ACPI / APD: Remove the unneededAPD_ADDR(desc)macro define ACPI / APD: Head file including cleanups
All applied as 5.10 material with edited subjects and changelogs, thanks!