Devicetree
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: hci_h5: directly return hci_uart_register_device() ret-val
@ 2021-09-24  9:41 Hans de Goede
  2021-09-24  9:42 ` Hans de Goede
  0 siblings, 1 reply; 2+ messages in thread
From: Hans de Goede @ 2021-09-24  9:41 UTC (permalink / raw)
  To: Marcel Holtmann, Johan Hedberg, Luiz Augusto von Dentz
  Cc: Hans de Goede, devicetree, Archie Pusaka

Since the hci_uart_register_device() call is the last thing we do in
h5_serdev_probe() we can simply directly return its return-value.

Cc: Archie Pusaka <apusaka@google.com>
Suggested-by: Archie Pusaka <apusaka@google.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/bluetooth/hci_h5.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/bluetooth/hci_h5.c b/drivers/bluetooth/hci_h5.c
index 59b712742d33..3e067c7cabff 100644
--- a/drivers/bluetooth/hci_h5.c
+++ b/drivers/bluetooth/hci_h5.c
@@ -814,7 +814,6 @@ static int h5_serdev_probe(struct serdev_device *serdev)
 	struct device *dev = &serdev->dev;
 	struct h5 *h5;
 	const struct h5_device_data *data;
-	int err;
 
 	h5 = devm_kzalloc(dev, sizeof(*h5), GFP_KERNEL);
 	if (!h5)
@@ -858,11 +857,7 @@ static int h5_serdev_probe(struct serdev_device *serdev)
 	if (IS_ERR(h5->device_wake_gpio))
 		return PTR_ERR(h5->device_wake_gpio);
 
-	err = hci_uart_register_device(&h5->serdev_hu, &h5p);
-	if (err)
-		return err;
-
-	return 0;
+	return hci_uart_register_device(&h5->serdev_hu, &h5p);
 }
 
 static void h5_serdev_remove(struct serdev_device *serdev)
-- 
2.31.1


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

* Re: [PATCH] Bluetooth: hci_h5: directly return hci_uart_register_device() ret-val
  2021-09-24  9:41 [PATCH] Bluetooth: hci_h5: directly return hci_uart_register_device() ret-val Hans de Goede
@ 2021-09-24  9:42 ` Hans de Goede
  0 siblings, 0 replies; 2+ messages in thread
From: Hans de Goede @ 2021-09-24  9:42 UTC (permalink / raw)
  To: Marcel Holtmann, Johan Hedberg, Luiz Augusto von Dentz
  Cc: devicetree, Archie Pusaka

Hi,

I accidentally send this to the device-tree list instead of to the
bluetooth list. So I'm going to resend this now to the right list.

Note the second copy you will receive is unchanged, I'm just fixing the
Cc.

Regards,

Hans


On 9/24/21 11:41 AM, Hans de Goede wrote:
> Since the hci_uart_register_device() call is the last thing we do in
> h5_serdev_probe() we can simply directly return its return-value.
> 
> Cc: Archie Pusaka <apusaka@google.com>
> Suggested-by: Archie Pusaka <apusaka@google.com>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>  drivers/bluetooth/hci_h5.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/drivers/bluetooth/hci_h5.c b/drivers/bluetooth/hci_h5.c
> index 59b712742d33..3e067c7cabff 100644
> --- a/drivers/bluetooth/hci_h5.c
> +++ b/drivers/bluetooth/hci_h5.c
> @@ -814,7 +814,6 @@ static int h5_serdev_probe(struct serdev_device *serdev)
>  	struct device *dev = &serdev->dev;
>  	struct h5 *h5;
>  	const struct h5_device_data *data;
> -	int err;
>  
>  	h5 = devm_kzalloc(dev, sizeof(*h5), GFP_KERNEL);
>  	if (!h5)
> @@ -858,11 +857,7 @@ static int h5_serdev_probe(struct serdev_device *serdev)
>  	if (IS_ERR(h5->device_wake_gpio))
>  		return PTR_ERR(h5->device_wake_gpio);
>  
> -	err = hci_uart_register_device(&h5->serdev_hu, &h5p);
> -	if (err)
> -		return err;
> -
> -	return 0;
> +	return hci_uart_register_device(&h5->serdev_hu, &h5p);
>  }
>  
>  static void h5_serdev_remove(struct serdev_device *serdev)
> 


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

end of thread, other threads:[~2021-09-24  9:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-24  9:41 [PATCH] Bluetooth: hci_h5: directly return hci_uart_register_device() ret-val Hans de Goede
2021-09-24  9:42 ` 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