Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1400580 > unrolled thread

[patch net-next 06/11] ACPI: bus: move acpi_match_device_ids() to linux/acpi.h

Started byYisen Zhuang <Yisen.Zhuang@huawei.com>
First post2016-05-13 10:10 +0200
Last post2016-05-16 04:10 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [patch net-next 06/11] ACPI: bus: move acpi_match_device_ids() to linux/acpi.h Yisen Zhuang <Yisen.Zhuang@huawei.com> - 2016-05-13 10:10 +0200
    Re: [patch net-next 06/11] ACPI: bus: move acpi_match_device_ids()  to linux/acpi.h Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-05-13 15:20 +0200
      Re: [patch net-next 06/11] ACPI: bus: move acpi_match_device_ids() to  linux/acpi.h "Yankejian (Hackim Yim)" <yankejian@huawei.com> - 2016-05-16 04:10 +0200

#1400580 — [patch net-next 06/11] ACPI: bus: move acpi_match_device_ids() to linux/acpi.h

FromYisen Zhuang <Yisen.Zhuang@huawei.com>
Date2016-05-13 10:10 +0200
Subject[patch net-next 06/11] ACPI: bus: move acpi_match_device_ids() to linux/acpi.h
Message-ID<rygky-7Xv-11@gated-at.bofh.it>
From: Hanjun Guo <hanjun.guo@linaro.org>

acpi_match_device_ids() will be used for drivers to match
different hardware versions, it will be compiled in non-ACPI
case, but acpi_match_device_ids() in acpi_bus.h and it can
only be used in ACPI case, so move it to linux/acpi.h and
introduce a stub function for it.

Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Signed-off-by: Kejian Yan <yankejian@huawei.com>
Signed-off-by: Yisen Zhuang <Yisen.Zhuang@huawei.com>
---
 include/acpi/acpi_bus.h |  2 --
 include/linux/acpi.h    | 11 +++++++++++
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 3a93250..12cf2cb 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -513,8 +513,6 @@ void acpi_bus_unregister_driver(struct acpi_driver *driver);
 int acpi_bus_scan(acpi_handle handle);
 void acpi_bus_trim(struct acpi_device *start);
 acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle * ejd);
-int acpi_match_device_ids(struct acpi_device *device,
-			  const struct acpi_device_id *ids);
 int acpi_create_dir(struct acpi_device *);
 void acpi_remove_dir(struct acpi_device *);
 
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 06ed7e5..e578bce 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -933,7 +933,18 @@ int __acpi_probe_device_table(struct acpi_probe_entry *start, int nr);
 					  (&ACPI_PROBE_TABLE_END(t) -	\
 					   &ACPI_PROBE_TABLE(t)));	\
 	})
+
+int acpi_match_device_ids(struct acpi_device *device,
+			  const struct acpi_device_id *ids);
+
 #else
+
+static inline int acpi_match_device_ids(struct acpi_device *device,
+					const struct acpi_device_id *ids)
+{
+	return -ENOENT;
+}
+
 static inline int acpi_dev_get_property(struct acpi_device *adev,
 					const char *name, acpi_object_type type,
 					const union acpi_object **obj)
-- 
1.9.1

[toc] | [next] | [standalone]


#1400786 — Re: [patch net-next 06/11] ACPI: bus: move acpi_match_device_ids() to linux/acpi.h

FromAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Date2016-05-13 15:20 +0200
SubjectRe: [patch net-next 06/11] ACPI: bus: move acpi_match_device_ids() to linux/acpi.h
Message-ID<rylax-3Vi-11@gated-at.bofh.it>
In reply to#1400580
On Fri, 2016-05-13 at 16:19 +0800, Yisen Zhuang wrote:
> From: Hanjun Guo <hanjun.guo@linaro.org>
> 
> acpi_match_device_ids() will be used for drivers to match
> different hardware versions, it will be compiled in non-ACPI
> case, but acpi_match_device_ids() in acpi_bus.h and it can
> only be used in ACPI case, so move it to linux/acpi.h and
> introduce a stub function for it.

I somehow doubt this is right move.

Like I said in the previous comment the architectural split might make
this a bit better.

You might use 

#ifdef IS_ENABLED(CONFIG_ACPI)
#else
#endif

only once to some big part of code. If kernel is build without ACPI
support you even will not have this in your driver at all.

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

[toc] | [prev] | [next] | [standalone]


#1401184 — Re: [patch net-next 06/11] ACPI: bus: move acpi_match_device_ids() to linux/acpi.h

From"Yankejian (Hackim Yim)" <yankejian@huawei.com>
Date2016-05-16 04:10 +0200
SubjectRe: [patch net-next 06/11] ACPI: bus: move acpi_match_device_ids() to linux/acpi.h
Message-ID<rzg8S-u7-121@gated-at.bofh.it>
In reply to#1400786

On 2016/5/13 21:15, Andy Shevchenko wrote:
> On Fri, 2016-05-13 at 16:19 +0800, Yisen Zhuang wrote:
>> From: Hanjun Guo <hanjun.guo@linaro.org>
>>
>> acpi_match_device_ids() will be used for drivers to match
>> different hardware versions, it will be compiled in non-ACPI
>> case, but acpi_match_device_ids() in acpi_bus.h and it can
>> only be used in ACPI case, so move it to linux/acpi.h and
>> introduce a stub function for it.
> I somehow doubt this is right move.
>
> Like I said in the previous comment the architectural split might make
> this a bit better.
>
> You might use 
>
> #ifdef IS_ENABLED(CONFIG_ACPI)
> #else
> #endif
>
> only once to some big part of code. If kernel is build without ACPI
> support you even will not have this in your driver at all.

Hi Andy,

Thanks for your suggestions. It will add stub function instead in next submit.


> -- 
> Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Intel Finland Oy
>
>
> .
>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web