linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hwmon: xgene: Minor clean up of ifdef and acpi_match_table reference
@ 2017-10-31 20:58 Hoan Tran
  2017-11-01 13:15 ` Guenter Roeck
  0 siblings, 1 reply; 3+ messages in thread
From: Hoan Tran @ 2017-10-31 20:58 UTC (permalink / raw)
  To: Guenter Roeck, Jean Delvare
  Cc: linux-hwmon, linux-kernel, lho, patches, Hoan Tran

This patch removes the un-necessary ifdef CONFIG_ACPI and directly
uses the acpi_match_table from the driver pdev.

Signed-off-by: Hoan Tran <hotran@apm.com>
---
 drivers/hwmon/xgene-hwmon.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/hwmon/xgene-hwmon.c b/drivers/hwmon/xgene-hwmon.c
index 5783436..85c4e3d 100644
--- a/drivers/hwmon/xgene-hwmon.c
+++ b/drivers/hwmon/xgene-hwmon.c
@@ -665,16 +665,15 @@ static int xgene_hwmon_probe(struct platform_device *pdev)
 		}
 	} else {
 		struct acpi_pcct_hw_reduced *cppc_ss;
-		int version = XGENE_HWMON_V1;
-#ifdef CONFIG_ACPI
 		const struct acpi_device_id *acpi_id;
+		int version = XGENE_HWMON_V1;
 
-		acpi_id = acpi_match_device(xgene_hwmon_acpi_match, &pdev->dev);
+		acpi_id = acpi_match_device(pdev->dev.driver->acpi_match_table,
+					    &pdev->dev);
 		if (!acpi_id)
 			return -EINVAL;
 
 		version = (int)acpi_id->driver_data;
-#endif
 
 		if (device_property_read_u32(&pdev->dev, "pcc-channel",
 					     &ctx->mbox_idx)) {
-- 
2.7.4

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

* Re: hwmon: xgene: Minor clean up of ifdef and acpi_match_table reference
  2017-10-31 20:58 [PATCH] hwmon: xgene: Minor clean up of ifdef and acpi_match_table reference Hoan Tran
@ 2017-11-01 13:15 ` Guenter Roeck
  2017-11-01 15:33   ` Hoan Tran
  0 siblings, 1 reply; 3+ messages in thread
From: Guenter Roeck @ 2017-11-01 13:15 UTC (permalink / raw)
  To: hotran; +Cc: Jean Delvare, linux-hwmon, linux-kernel, lho, patches

On Tue, Oct 31, 2017 at 01:58:07PM -0700, hotran wrote:
> This patch removes the un-necessary ifdef CONFIG_ACPI and directly
> uses the acpi_match_table from the driver pdev.
> 
> Signed-off-by: Hoan Tran <hotran@apm.com>

Applied to hwmon-next, with now unnecessary initialization of 'version'
removed.

Thanks,
Guenter

> ---
>  drivers/hwmon/xgene-hwmon.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/hwmon/xgene-hwmon.c b/drivers/hwmon/xgene-hwmon.c
> index 5783436..85c4e3d 100644
> --- a/drivers/hwmon/xgene-hwmon.c
> +++ b/drivers/hwmon/xgene-hwmon.c
> @@ -665,16 +665,15 @@ static int xgene_hwmon_probe(struct platform_device *pdev)
>  		}
>  	} else {
>  		struct acpi_pcct_hw_reduced *cppc_ss;
> -		int version = XGENE_HWMON_V1;
> -#ifdef CONFIG_ACPI
>  		const struct acpi_device_id *acpi_id;
> +		int version = XGENE_HWMON_V1;
>  
> -		acpi_id = acpi_match_device(xgene_hwmon_acpi_match, &pdev->dev);
> +		acpi_id = acpi_match_device(pdev->dev.driver->acpi_match_table,
> +					    &pdev->dev);
>  		if (!acpi_id)
>  			return -EINVAL;
>  
>  		version = (int)acpi_id->driver_data;
> -#endif
>  
>  		if (device_property_read_u32(&pdev->dev, "pcc-channel",
>  					     &ctx->mbox_idx)) {

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

* Re: hwmon: xgene: Minor clean up of ifdef and acpi_match_table reference
  2017-11-01 13:15 ` Guenter Roeck
@ 2017-11-01 15:33   ` Hoan Tran
  0 siblings, 0 replies; 3+ messages in thread
From: Hoan Tran @ 2017-11-01 15:33 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: Jean Delvare, linux-hwmon, lkml, Loc Ho, patches

On Wed, Nov 1, 2017 at 6:15 AM, Guenter Roeck <linux@roeck-us.net> wrote:
> On Tue, Oct 31, 2017 at 01:58:07PM -0700, hotran wrote:
>> This patch removes the un-necessary ifdef CONFIG_ACPI and directly
>> uses the acpi_match_table from the driver pdev.
>>
>> Signed-off-by: Hoan Tran <hotran@apm.com>
>
> Applied to hwmon-next, with now unnecessary initialization of 'version'
> removed.

Thanks, Guenter

Regards
Hoan

>
> Thanks,
> Guenter
>
>> ---
>>  drivers/hwmon/xgene-hwmon.c | 7 +++----
>>  1 file changed, 3 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/hwmon/xgene-hwmon.c b/drivers/hwmon/xgene-hwmon.c
>> index 5783436..85c4e3d 100644
>> --- a/drivers/hwmon/xgene-hwmon.c
>> +++ b/drivers/hwmon/xgene-hwmon.c
>> @@ -665,16 +665,15 @@ static int xgene_hwmon_probe(struct platform_device *pdev)
>>               }
>>       } else {
>>               struct acpi_pcct_hw_reduced *cppc_ss;
>> -             int version = XGENE_HWMON_V1;
>> -#ifdef CONFIG_ACPI
>>               const struct acpi_device_id *acpi_id;
>> +             int version = XGENE_HWMON_V1;
>>
>> -             acpi_id = acpi_match_device(xgene_hwmon_acpi_match, &pdev->dev);
>> +             acpi_id = acpi_match_device(pdev->dev.driver->acpi_match_table,
>> +                                         &pdev->dev);
>>               if (!acpi_id)
>>                       return -EINVAL;
>>
>>               version = (int)acpi_id->driver_data;
>> -#endif
>>
>>               if (device_property_read_u32(&pdev->dev, "pcc-channel",
>>                                            &ctx->mbox_idx)) {

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

end of thread, other threads:[~2017-11-01 15:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-31 20:58 [PATCH] hwmon: xgene: Minor clean up of ifdef and acpi_match_table reference Hoan Tran
2017-11-01 13:15 ` Guenter Roeck
2017-11-01 15:33   ` Hoan Tran

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).