All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/5] Cleanups for ACPI APD driver
@ 2020-09-07 12:57 Hanjun Guo
  2020-09-07 12:57 ` [PATCH v2 1/5] ACPI / APD: Add kernel doc for the properties in struct apd_device_desc Hanjun Guo
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Hanjun Guo @ 2020-09-07 12:57 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: linux-acpi, lkp, Ken Xue, 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.

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(-)

-- 
1.7.12.4


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2 1/5] ACPI / APD: Add kernel doc for the properties in struct apd_device_desc
  2020-09-07 12:57 [PATCH v2 0/5] Cleanups for ACPI APD driver Hanjun Guo
@ 2020-09-07 12:57 ` Hanjun Guo
  2020-09-07 12:57 ` [PATCH v2 2/5] ACPI / APD: Remove the flags " Hanjun Guo
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Hanjun Guo @ 2020-09-07 12:57 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: linux-acpi, lkp, Ken Xue, Hanjun Guo

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.

Signed-off-by: Hanjun Guo <guohanjun@huawei.com>
---
 drivers/acpi/acpi_apd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/acpi/acpi_apd.c b/drivers/acpi/acpi_apd.c
index 4c34837..6f39289 100644
--- a/drivers/acpi/acpi_apd.c
+++ b/drivers/acpi/acpi_apd.c
@@ -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
-- 
1.7.12.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 2/5] ACPI / APD: Remove the flags in struct apd_device_desc
  2020-09-07 12:57 [PATCH v2 0/5] Cleanups for ACPI APD driver Hanjun Guo
  2020-09-07 12:57 ` [PATCH v2 1/5] ACPI / APD: Add kernel doc for the properties in struct apd_device_desc Hanjun Guo
@ 2020-09-07 12:57 ` Hanjun Guo
  2020-09-07 12:57 ` [PATCH v2 3/5] ACPI / APD: Remove ACPI_MODULE_NAME() Hanjun Guo
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Hanjun Guo @ 2020-09-07 12:57 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: linux-acpi, lkp, Ken Xue, Hanjun Guo

The flags is not used in anywhere, remove it and its related
code.

Signed-off-by: Hanjun Guo <guohanjun@huawei.com>
---
 drivers/acpi/acpi_apd.c | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/drivers/acpi/acpi_apd.c b/drivers/acpi/acpi_apd.c
index 6f39289..c4bc4ab 100644
--- a/drivers/acpi/acpi_apd.c
+++ b/drivers/acpi/acpi_apd.c
@@ -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);
-- 
1.7.12.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 3/5] ACPI / APD: Remove ACPI_MODULE_NAME()
  2020-09-07 12:57 [PATCH v2 0/5] Cleanups for ACPI APD driver Hanjun Guo
  2020-09-07 12:57 ` [PATCH v2 1/5] ACPI / APD: Add kernel doc for the properties in struct apd_device_desc Hanjun Guo
  2020-09-07 12:57 ` [PATCH v2 2/5] ACPI / APD: Remove the flags " Hanjun Guo
@ 2020-09-07 12:57 ` Hanjun Guo
  2020-09-07 12:57 ` [PATCH v2 4/5] ACPI / APD: Remove the unneeded APD_ADDR(desc) macro define Hanjun Guo
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Hanjun Guo @ 2020-09-07 12:57 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: linux-acpi, lkp, Ken Xue, Hanjun Guo

ACPI_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().

Signed-off-by: Hanjun Guo <guohanjun@huawei.com>
---
 drivers/acpi/acpi_apd.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/acpi/acpi_apd.c b/drivers/acpi/acpi_apd.c
index c4bc4ab..4dbf85b 100644
--- a/drivers/acpi/acpi_apd.c
+++ b/drivers/acpi/acpi_apd.c
@@ -19,7 +19,6 @@
 
 #include "internal.h"
 
-ACPI_MODULE_NAME("acpi_apd");
 struct apd_private_data;
 
 /**
-- 
1.7.12.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 4/5] ACPI / APD: Remove the unneeded APD_ADDR(desc) macro define
  2020-09-07 12:57 [PATCH v2 0/5] Cleanups for ACPI APD driver Hanjun Guo
                   ` (2 preceding siblings ...)
  2020-09-07 12:57 ` [PATCH v2 3/5] ACPI / APD: Remove ACPI_MODULE_NAME() Hanjun Guo
@ 2020-09-07 12:57 ` Hanjun Guo
  2020-09-07 12:57 ` [PATCH v2 5/5] ACPI / APD: Head file including cleanups Hanjun Guo
  2020-09-25 10:51 ` [PATCH v2 0/5] Cleanups for ACPI APD driver Rafael J. Wysocki
  5 siblings, 0 replies; 7+ messages in thread
From: Hanjun Guo @ 2020-09-07 12:57 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: linux-acpi, lkp, Ken Xue, Hanjun Guo

Since 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.

Signed-off-by: Hanjun Guo <guohanjun@huawei.com>
---
 drivers/acpi/acpi_apd.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/acpi/acpi_apd.c b/drivers/acpi/acpi_apd.c
index 4dbf85b..561d9ba 100644
--- a/drivers/acpi/acpi_apd.c
+++ b/drivers/acpi/acpi_apd.c
@@ -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.
-- 
1.7.12.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 5/5] ACPI / APD: Head file including cleanups
  2020-09-07 12:57 [PATCH v2 0/5] Cleanups for ACPI APD driver Hanjun Guo
                   ` (3 preceding siblings ...)
  2020-09-07 12:57 ` [PATCH v2 4/5] ACPI / APD: Remove the unneeded APD_ADDR(desc) macro define Hanjun Guo
@ 2020-09-07 12:57 ` Hanjun Guo
  2020-09-25 10:51 ` [PATCH v2 0/5] Cleanups for ACPI APD driver Rafael J. Wysocki
  5 siblings, 0 replies; 7+ messages in thread
From: Hanjun Guo @ 2020-09-07 12:57 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: linux-acpi, lkp, Ken Xue, Hanjun Guo

Make the including head files to be alphabetical order, and
remove the not needed head file inclusion.

Signed-off-by: Hanjun Guo <guohanjun@huawei.com>
---
 drivers/acpi/acpi_apd.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/acpi/acpi_apd.c b/drivers/acpi/acpi_apd.c
index 561d9ba..05855db 100644
--- a/drivers/acpi/acpi_apd.c
+++ b/drivers/acpi/acpi_apd.c
@@ -7,15 +7,13 @@
  *	Wu, Jeff <Jeff.Wu@amd.com>
  */
 
-#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"
 
-- 
1.7.12.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 0/5] Cleanups for ACPI APD driver
  2020-09-07 12:57 [PATCH v2 0/5] Cleanups for ACPI APD driver Hanjun Guo
                   ` (4 preceding siblings ...)
  2020-09-07 12:57 ` [PATCH v2 5/5] ACPI / APD: Head file including cleanups Hanjun Guo
@ 2020-09-25 10:51 ` Rafael J. Wysocki
  5 siblings, 0 replies; 7+ messages in thread
From: Rafael J. Wysocki @ 2020-09-25 10:51 UTC (permalink / raw)
  To: Hanjun Guo
  Cc: Rafael J. Wysocki, ACPI Devel Maling List, kbuild test robot, Ken Xue

On Mon, Sep 7, 2020 at 7:46 PM Hanjun Guo <guohanjun@huawei.com> wrote:
>
> 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

All applied as 5.10 material with edited subjects and changelogs, thanks!

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-09-25 10:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-07 12:57 [PATCH v2 0/5] Cleanups for ACPI APD driver Hanjun Guo
2020-09-07 12:57 ` [PATCH v2 1/5] ACPI / APD: Add kernel doc for the properties in struct apd_device_desc Hanjun Guo
2020-09-07 12:57 ` [PATCH v2 2/5] ACPI / APD: Remove the flags " Hanjun Guo
2020-09-07 12:57 ` [PATCH v2 3/5] ACPI / APD: Remove ACPI_MODULE_NAME() Hanjun Guo
2020-09-07 12:57 ` [PATCH v2 4/5] ACPI / APD: Remove the unneeded APD_ADDR(desc) macro define Hanjun Guo
2020-09-07 12:57 ` [PATCH v2 5/5] ACPI / APD: Head file including cleanups Hanjun Guo
2020-09-25 10:51 ` [PATCH v2 0/5] Cleanups for ACPI APD driver Rafael J. Wysocki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.