LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Maximilian Luz <luzmaximilian@gmail.com>,
	Lee Jones <lee.jones@linaro.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org,
	platform-driver-x86@vger.kernel.org,
	linux-serial@vger.kernel.org
Cc: Marcel Holtmann <marcel@holtmann.org>,
	Johan Hedberg <johan.hedberg@gmail.com>,
	Luiz Augusto von Dentz <luiz.dentz@gmail.com>,
	Mark Gross <mgross@linux.intel.com>,
	Rob Herring <robh@kernel.org>, Jiri Slaby <jirislaby@kernel.org>
Subject: Re: [PATCH v1 4/5] Bluetooth: hci_bcm: Use acpi_gpio_get_*_resource() helpers
Date: Wed, 4 Aug 2021 10:04:19 +0200	[thread overview]
Message-ID: <9fceba7d-627b-bec2-6315-46e66b646534@redhat.com> (raw)
In-Reply-To: <20210803192905.72246-4-andriy.shevchenko@linux.intel.com>

Hi,

On 8/3/21 9:29 PM, Andy Shevchenko wrote:
> ACPI provides generic helpers to get GPIO interrupt and IO resources.
> Use it instead of open coded variant.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

As explained in my reply to 3/5 this makes the code a lot harder
to read with little to no gain, so NACK from me for this one.

Regards,

Hans

> ---
>  drivers/bluetooth/hci_bcm.c | 15 ++++++---------
>  1 file changed, 6 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c
> index 16f854ac19b6..ed99fcde2523 100644
> --- a/drivers/bluetooth/hci_bcm.c
> +++ b/drivers/bluetooth/hci_bcm.c
> @@ -911,15 +911,6 @@ static int bcm_resource(struct acpi_resource *ares, void *data)
>  		dev->irq_active_low = true;
>  		break;
>  
> -	case ACPI_RESOURCE_TYPE_GPIO:
> -		gpio = &ares->data.gpio;
> -		if (gpio->connection_type == ACPI_RESOURCE_GPIO_TYPE_INT) {
> -			dev->gpio_int_idx = dev->gpio_count;
> -			dev->irq_active_low = gpio->polarity == ACPI_ACTIVE_LOW;
> -		}
> -		dev->gpio_count++;
> -		break;
> -
>  	default:
>  		break;
>  	}
> @@ -927,6 +918,12 @@ static int bcm_resource(struct acpi_resource *ares, void *data)
>  	if (serdev_acpi_get_uart_resource(ares, &uart)) {
>  		dev->init_speed = uart->default_baud_rate;
>  		dev->oper_speed = 4000000;
> +	} else if (acpi_gpio_get_irq_resource(ares, &gpio)) {
> +		dev->gpio_int_idx = dev->gpio_count;
> +		dev->irq_active_low = gpio->polarity == ACPI_ACTIVE_LOW;
> +		dev->gpio_count++;
> +	} else if (acpi_gpio_get_io_resource(ares, &gpio)) {
> +		dev->gpio_count++;
>  	}
>  
>  	return 0;
> 


  reply	other threads:[~2021-08-04  8:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-03 19:29 [PATCH v1 1/5] serdev: Split and export serdev_acpi_get_uart_resource() Andy Shevchenko
2021-08-03 19:29 ` [PATCH v1 2/5] platform/surface: aggregator: Use serdev_acpi_get_uart_resource() helper Andy Shevchenko
2021-08-03 19:47   ` Maximilian Luz
2021-08-03 19:29 ` [PATCH v1 3/5] Bluetooth: hci_bcm: " Andy Shevchenko
2021-08-04  8:12   ` Hans de Goede
2021-08-04  8:42     ` Andy Shevchenko
2021-08-04  9:35       ` Hans de Goede
2021-08-03 19:29 ` [PATCH v1 4/5] Bluetooth: hci_bcm: Use acpi_gpio_get_*_resource() helpers Andy Shevchenko
2021-08-04  8:04   ` Hans de Goede [this message]
2021-08-03 19:29 ` [PATCH v1 5/5] Bluetooth: hci_bcm: Fix kernel doc comments Andy Shevchenko
2021-08-04  8:08 ` [PATCH v1 1/5] serdev: Split and export serdev_acpi_get_uart_resource() Hans de Goede
2021-08-04 12:07   ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9fceba7d-627b-bec2-6315-46e66b646534@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=johan.hedberg@gmail.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=luzmaximilian@gmail.com \
    --cc=marcel@holtmann.org \
    --cc=mgross@linux.intel.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=robh@kernel.org \
    --subject='Re: [PATCH v1 4/5] Bluetooth: hci_bcm: Use acpi_gpio_get_*_resource() helpers' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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