LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH v1 1/1] platform/surface: surface3_power: Use i2c_acpi_get_i2c_resource() helper
@ 2021-08-03 16:32 Andy Shevchenko
2021-08-03 17:22 ` Maximilian Luz
2021-08-06 13:38 ` Hans de Goede
0 siblings, 2 replies; 3+ messages in thread
From: Andy Shevchenko @ 2021-08-03 16:32 UTC (permalink / raw)
To: Andy Shevchenko, platform-driver-x86, linux-kernel
Cc: Hans de Goede, Mark Gross, Maximilian Luz
ACPI provides a generic helper to get I²C Serial Bus resources.
Use it instead of open coded variant.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/platform/surface/surface3_power.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/platform/surface/surface3_power.c b/drivers/platform/surface/surface3_power.c
index dea82aa1abd4..90c1568ea4e0 100644
--- a/drivers/platform/surface/surface3_power.c
+++ b/drivers/platform/surface/surface3_power.c
@@ -384,13 +384,7 @@ mshw0011_space_handler(u32 function, acpi_physical_address command,
if (ACPI_FAILURE(ret))
return ret;
- if (!value64 || ares->type != ACPI_RESOURCE_TYPE_SERIAL_BUS) {
- ret = AE_BAD_PARAMETER;
- goto err;
- }
-
- sb = &ares->data.i2c_serial_bus;
- if (sb->type != ACPI_RESOURCE_SERIAL_TYPE_I2C) {
+ if (!value64 || !i2c_acpi_get_i2c_resource(ares, &sb)) {
ret = AE_BAD_PARAMETER;
goto err;
}
--
2.30.2
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v1 1/1] platform/surface: surface3_power: Use i2c_acpi_get_i2c_resource() helper
2021-08-03 16:32 [PATCH v1 1/1] platform/surface: surface3_power: Use i2c_acpi_get_i2c_resource() helper Andy Shevchenko
@ 2021-08-03 17:22 ` Maximilian Luz
2021-08-06 13:38 ` Hans de Goede
1 sibling, 0 replies; 3+ messages in thread
From: Maximilian Luz @ 2021-08-03 17:22 UTC (permalink / raw)
To: Andy Shevchenko, platform-driver-x86, linux-kernel
Cc: Hans de Goede, Mark Gross
On 8/3/21 6:32 PM, Andy Shevchenko wrote:
> ACPI provides a generic helper to get I²C Serial Bus resources.
> Use it instead of open coded variant.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Looks good to me, thanks!
Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com>
> ---
> drivers/platform/surface/surface3_power.c | 8 +-------
> 1 file changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/drivers/platform/surface/surface3_power.c b/drivers/platform/surface/surface3_power.c
> index dea82aa1abd4..90c1568ea4e0 100644
> --- a/drivers/platform/surface/surface3_power.c
> +++ b/drivers/platform/surface/surface3_power.c
> @@ -384,13 +384,7 @@ mshw0011_space_handler(u32 function, acpi_physical_address command,
> if (ACPI_FAILURE(ret))
> return ret;
>
> - if (!value64 || ares->type != ACPI_RESOURCE_TYPE_SERIAL_BUS) {
> - ret = AE_BAD_PARAMETER;
> - goto err;
> - }
> -
> - sb = &ares->data.i2c_serial_bus;
> - if (sb->type != ACPI_RESOURCE_SERIAL_TYPE_I2C) {
> + if (!value64 || !i2c_acpi_get_i2c_resource(ares, &sb)) {
> ret = AE_BAD_PARAMETER;
> goto err;
> }
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v1 1/1] platform/surface: surface3_power: Use i2c_acpi_get_i2c_resource() helper
2021-08-03 16:32 [PATCH v1 1/1] platform/surface: surface3_power: Use i2c_acpi_get_i2c_resource() helper Andy Shevchenko
2021-08-03 17:22 ` Maximilian Luz
@ 2021-08-06 13:38 ` Hans de Goede
1 sibling, 0 replies; 3+ messages in thread
From: Hans de Goede @ 2021-08-06 13:38 UTC (permalink / raw)
To: Andy Shevchenko, platform-driver-x86, linux-kernel
Cc: Mark Gross, Maximilian Luz
Hi,
On 8/3/21 6:32 PM, Andy Shevchenko wrote:
> ACPI provides a generic helper to get I²C Serial Bus resources.
> Use it instead of open coded variant.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Thank you for your patch, I've applied this patch to my review-hans
branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans
Note it will show up in my review-hans branch once I've pushed my
local branch there, which might take a while.
Once I've run some tests on this branch the patches there will be
added to the platform-drivers-x86/for-next branch and eventually
will be included in the pdx86 pull-request to Linus for the next
merge-window.
Regards,
Hans
> ---
> drivers/platform/surface/surface3_power.c | 8 +-------
> 1 file changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/drivers/platform/surface/surface3_power.c b/drivers/platform/surface/surface3_power.c
> index dea82aa1abd4..90c1568ea4e0 100644
> --- a/drivers/platform/surface/surface3_power.c
> +++ b/drivers/platform/surface/surface3_power.c
> @@ -384,13 +384,7 @@ mshw0011_space_handler(u32 function, acpi_physical_address command,
> if (ACPI_FAILURE(ret))
> return ret;
>
> - if (!value64 || ares->type != ACPI_RESOURCE_TYPE_SERIAL_BUS) {
> - ret = AE_BAD_PARAMETER;
> - goto err;
> - }
> -
> - sb = &ares->data.i2c_serial_bus;
> - if (sb->type != ACPI_RESOURCE_SERIAL_TYPE_I2C) {
> + if (!value64 || !i2c_acpi_get_i2c_resource(ares, &sb)) {
> ret = AE_BAD_PARAMETER;
> goto err;
> }
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-08-06 13:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-03 16:32 [PATCH v1 1/1] platform/surface: surface3_power: Use i2c_acpi_get_i2c_resource() helper Andy Shevchenko
2021-08-03 17:22 ` Maximilian Luz
2021-08-06 13:38 ` Hans de Goede
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).