Re: [PATCH 1/3] Bluetooth: hci_bcm: Support Apple GPIO handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On 28-12-17 08:15, Lukas Wunner wrote:
On Tue, Dec 26, 2017 at 09:50:30PM +0100, Marcel Holtmann wrote:
+}
+
+static int bcm_apple_set_power(struct bcm_device *dev, bool enable)
+{
+	return ACPI_SUCCESS(acpi_evaluate_object(enable ? dev->btpu : dev->btpd,
+						 NULL, NULL, NULL))
+								 ? 0 : -EFAULT;

Same here. Trying to mush everything in a single statement seems overkill.
And btw. why -EFAULT? Is that standard error practice with ACPI?

-EFAULT was just chosen as a generic error because we don't really know
what went wrong with the ACPI call.  It seems there's no function to
convert an ACPI exception code to an errno, only a function to convert it
to a human-readable string, acpi_format_exception().  If you have a
different preference than -EFAULT I'd be happy to change it.

In that case please use e.g. -EIO, or something else similar, EFAULT
has a very clear definition: userspace has called us with an invalid
address (which would cause a segfault when used from userspace code
directly), so please do not use it for anything else.

Regards,

Hans
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux