[alsa-devel] [RFC PATCH 15/15] ACPI/thinkpad: Fix wrong <acpi/acpi.h> inclusion in Thinkpad ACPI users.
CONFIG_ACPI dependent code should include <linux/acpi.h> instead of directly including <acpi/acpi.h>. This patch cleans up such wrong inclusions for Thinkpad ACPI users.
Cc: Henrique de Moraes Holschuh ibm-acpi@hmh.eng.br Cc: Jaroslav Kysela perex@perex.cz Cc: Takashi Iwai tiwai@suse.de Cc: alsa-devel@alsa-project.org Cc: ibm-acpi-devel@lists.sourceforge.net Cc: platform-driver-x86@vger.kernel.org Signed-off-by: Lv Zheng lv.zheng@intel.com --- drivers/platform/x86/thinkpad_acpi.c | 1 - include/linux/thinkpad_acpi.h | 2 ++ sound/pci/hda/patch_conexant.c | 1 - sound/pci/hda/patch_realtek.c | 1 - 4 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index defb6af..c114d7c 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -76,7 +76,6 @@ #include <linux/dmi.h> #include <linux/jiffies.h> #include <linux/workqueue.h> -#include <linux/acpi.h> #include <linux/pci_ids.h> #include <linux/thinkpad_acpi.h> #include <sound/core.h> diff --git a/include/linux/thinkpad_acpi.h b/include/linux/thinkpad_acpi.h index 361de59..02928eb 100644 --- a/include/linux/thinkpad_acpi.h +++ b/include/linux/thinkpad_acpi.h @@ -1,6 +1,8 @@ #ifndef __THINKPAD_ACPI_H__ #define __THINKPAD_ACPI_H__
+#include <linux/acpi.h> + /* These two functions return 0 if success, or negative error code (e g -ENODEV if no led present) */
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index 3fbf288..c2da489 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c @@ -3243,7 +3243,6 @@ enum { #if IS_ENABLED(CONFIG_THINKPAD_ACPI)
#include <linux/thinkpad_acpi.h> -#include <acpi/acpi.h>
static int (*led_set_func)(int, bool);
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 34de5dc..17306be 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -3726,7 +3726,6 @@ static void alc290_fixup_mono_speakers(struct hda_codec *codec, #if IS_ENABLED(CONFIG_THINKPAD_ACPI)
#include <linux/thinkpad_acpi.h> -#include <acpi/acpi.h>
static int (*led_set_func)(int, bool);
On Wed, 18 Dec 2013, Lv Zheng wrote:
CONFIG_ACPI dependent code should include <linux/acpi.h> instead of directly including <acpi/acpi.h>. This patch cleans up such wrong inclusions for Thinkpad ACPI users.
...
drivers/platform/x86/thinkpad_acpi.c | 1 - include/linux/thinkpad_acpi.h | 2 ++ sound/pci/hda/patch_conexant.c | 1 - sound/pci/hda/patch_realtek.c | 1 -
I'd prefer if you left the include outside of thinkpad_acpi.h, and just fix the include in the two ALSA users.
We might add some extra stuff to thinkpad_acpi.h someday, and not everything thinkpad_acpi does that might be useful to export to other areas of the kernel would require acpi.h.
Looking at patch_conexant and patch_realtek, it might be better to actually move the "am I running on a thinkpad" stuff they use acpi.h for into thinkpad_acpi, and provide a prototype for that in thinkpad_acpi.h.
At Wed, 18 Dec 2013 09:41:17 -0200, Henrique de Moraes Holschuh wrote:
On Wed, 18 Dec 2013, Lv Zheng wrote:
CONFIG_ACPI dependent code should include <linux/acpi.h> instead of directly including <acpi/acpi.h>. This patch cleans up such wrong inclusions for Thinkpad ACPI users.
...
drivers/platform/x86/thinkpad_acpi.c | 1 - include/linux/thinkpad_acpi.h | 2 ++ sound/pci/hda/patch_conexant.c | 1 - sound/pci/hda/patch_realtek.c | 1 -
I'd prefer if you left the include outside of thinkpad_acpi.h, and just fix the include in the two ALSA users.
Agreed.
We might add some extra stuff to thinkpad_acpi.h someday, and not everything thinkpad_acpi does that might be useful to export to other areas of the kernel would require acpi.h.
Looking at patch_conexant and patch_realtek, it might be better to actually move the "am I running on a thinkpad" stuff they use acpi.h for into thinkpad_acpi, and provide a prototype for that in thinkpad_acpi.h.
True, but we don't want to bind with thinkpad_acpi before identified that it's a thinkpad, so the code needs to be in hd-audio codec driver.
thanks,
Takashi
Hi, Takashi and Henrique
Thanks for reviewing and commenting.
From: linux-acpi-owner@vger.kernel.org [mailto:linux-acpi-owner@vger.kernel.org] On Behalf Of Takashi Iwai Sent: Wednesday, December 18, 2013 9:06 PM
At Wed, 18 Dec 2013 09:41:17 -0200, Henrique de Moraes Holschuh wrote:
On Wed, 18 Dec 2013, Lv Zheng wrote:
CONFIG_ACPI dependent code should include <linux/acpi.h> instead of directly including <acpi/acpi.h>. This patch cleans up such wrong inclusions for Thinkpad ACPI users.
...
drivers/platform/x86/thinkpad_acpi.c | 1 - include/linux/thinkpad_acpi.h | 2 ++ sound/pci/hda/patch_conexant.c | 1 - sound/pci/hda/patch_realtek.c | 1 -
I'd prefer if you left the include outside of thinkpad_acpi.h, and just fix the include in the two ALSA users.
Agreed.
We might add some extra stuff to thinkpad_acpi.h someday, and not everything thinkpad_acpi does that might be useful to export to other areas of the kernel would require acpi.h.
Looking at patch_conexant and patch_realtek, it might be better to actually move the "am I running on a thinkpad" stuff they use acpi.h for into thinkpad_acpi, and provide a prototype for that in thinkpad_acpi.h.
True, but we don't want to bind with thinkpad_acpi before identified that it's a thinkpad, so the code needs to be in hd-audio codec driver.
It looks to me like that there is a relationship between two Henrique's suggestions. His opinion is all ACPI stuff should be bound into thinkpad_acpi.c, that's why he suggested not to include <linux/acpi.h> in <linux/thinkpad_acpi.h>. So we might address both of them in order to follow.
I'm not sure if your opinion is: the hd-audio codec driver's needs cannot be met by addressing the second comment. And I'm not the right person that is able to test such code restructuring work. The target of this patchset is cleaning up wrong <acpi/acpi.h> inclusions, so let me focus on the first comment.
Can I just update this patch with <acpi/acpi.h> inclusions replaced by <linux/acpi.h> inclusions?
Thanks and best regards -Lv
thanks,
Takashi
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
At Fri, 20 Dec 2013 00:28:02 +0000, Zheng, Lv wrote:
Hi, Takashi and Henrique
Thanks for reviewing and commenting.
From: linux-acpi-owner@vger.kernel.org [mailto:linux-acpi-owner@vger.kernel.org] On Behalf Of Takashi Iwai Sent: Wednesday, December 18, 2013 9:06 PM
At Wed, 18 Dec 2013 09:41:17 -0200, Henrique de Moraes Holschuh wrote:
On Wed, 18 Dec 2013, Lv Zheng wrote:
CONFIG_ACPI dependent code should include <linux/acpi.h> instead of directly including <acpi/acpi.h>. This patch cleans up such wrong inclusions for Thinkpad ACPI users.
...
drivers/platform/x86/thinkpad_acpi.c | 1 - include/linux/thinkpad_acpi.h | 2 ++ sound/pci/hda/patch_conexant.c | 1 - sound/pci/hda/patch_realtek.c | 1 -
I'd prefer if you left the include outside of thinkpad_acpi.h, and just fix the include in the two ALSA users.
Agreed.
We might add some extra stuff to thinkpad_acpi.h someday, and not everything thinkpad_acpi does that might be useful to export to other areas of the kernel would require acpi.h.
Looking at patch_conexant and patch_realtek, it might be better to actually move the "am I running on a thinkpad" stuff they use acpi.h for into thinkpad_acpi, and provide a prototype for that in thinkpad_acpi.h.
True, but we don't want to bind with thinkpad_acpi before identified that it's a thinkpad, so the code needs to be in hd-audio codec driver.
It looks to me like that there is a relationship between two Henrique's suggestions. His opinion is all ACPI stuff should be bound into thinkpad_acpi.c, that's why he suggested not to include <linux/acpi.h> in <linux/thinkpad_acpi.h>. So we might address both of them in order to follow.
I'm not sure if your opinion is: the hd-audio codec driver's needs cannot be met by addressing the second comment.
My position is that some acpi code is needed in hd-audio codec driver because we need to probe thinkpad before binding with thinkpad_acpi. The codec driver is used by all machines with the same codec chips, and only few are thinkpads, so it's better not to bind statically for the rest others.
And I'm not the right person that is able to test such code restructuring work. The target of this patchset is cleaning up wrong <acpi/acpi.h> inclusions, so let me focus on the first comment.
Can I just update this patch with <acpi/acpi.h> inclusions replaced by <linux/acpi.h> inclusions?
Yes, that suffices.
Takashi
participants (4)
-
Henrique de Moraes Holschuh
-
Lv Zheng
-
Takashi Iwai
-
Zheng, Lv