linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] iio:light:acpi-als: add missing prefixes
@ 2015-07-17 22:56 Hartmut Knaack
  2015-07-19  9:51 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Hartmut Knaack @ 2015-07-17 22:56 UTC (permalink / raw)
  To: linux-iio
  Cc: Jonathan Cameron, Lars-Peter Clausen, Peter Meerwald, Marek Vasut,
	Martin Liska, Gabriele Mazzotta

Some macros and a function were missing the acpi_als_ prefix, so add it.

Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
---
 drivers/iio/light/acpi-als.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/iio/light/acpi-als.c b/drivers/iio/light/acpi-als.c
index 1dafa0756bfa..60537ec0c923 100644
--- a/drivers/iio/light/acpi-als.c
+++ b/drivers/iio/light/acpi-als.c
@@ -65,20 +65,20 @@ static const struct iio_chan_spec acpi_als_channels[] = {
  * to acpi_als_channels[], the evt_buffer below will grow
  * automatically.
  */
-#define EVT_NR_SOURCES		ARRAY_SIZE(acpi_als_channels)
-#define EVT_BUFFER_SIZE		\
-	(sizeof(s64) + (EVT_NR_SOURCES * sizeof(s32)))
+#define ACPI_ALS_EVT_NR_SOURCES		ARRAY_SIZE(acpi_als_channels)
+#define ACPI_ALS_EVT_BUFFER_SIZE		\
+	(sizeof(s64) + (ACPI_ALS_EVT_NR_SOURCES * sizeof(s32)))
 
 struct acpi_als {
 	struct acpi_device	*device;
 	struct mutex		lock;
 
-	s32			evt_buffer[EVT_BUFFER_SIZE];
+	s32			evt_buffer[ACPI_ALS_EVT_BUFFER_SIZE];
 };
 
 /*
  * All types of properties the ACPI0008 block can report. The ALI, ALC, ALT
- * and ALP can all be handled by als_read_value() below, while the ALR is
+ * and ALP can all be handled by acpi_als_read_value() below, while the ALR is
  * special.
  *
  * The _ALR property returns tables that can be used to fine-tune the values
@@ -93,7 +93,7 @@ struct acpi_als {
 #define ACPI_ALS_POLLING	"_ALP"
 #define ACPI_ALS_TABLES		"_ALR"
 
-static int als_read_value(struct acpi_als *als, char *prop, s32 *val)
+static int acpi_als_read_value(struct acpi_als *als, char *prop, s32 *val)
 {
 	unsigned long long temp_val;
 	acpi_status status;
@@ -122,11 +122,11 @@ static void acpi_als_notify(struct acpi_device *device, u32 event)
 
 	mutex_lock(&als->lock);
 
-	memset(buffer, 0, EVT_BUFFER_SIZE);
+	memset(buffer, 0, ACPI_ALS_EVT_BUFFER_SIZE);
 
 	switch (event) {
 	case ACPI_ALS_NOTIFY_ILLUMINANCE:
-		ret = als_read_value(als, ACPI_ALS_ILLUMINANCE, &val);
+		ret = acpi_als_read_value(als, ACPI_ALS_ILLUMINANCE, &val);
 		if (ret < 0)
 			goto out;
 		*buffer++ = val;
@@ -159,7 +159,7 @@ static int acpi_als_read_raw(struct iio_dev *indio_dev,
 	if (chan->type != IIO_LIGHT)
 		return -EINVAL;
 
-	ret = als_read_value(als, ACPI_ALS_ILLUMINANCE, &temp_val);
+	ret = acpi_als_read_value(als, ACPI_ALS_ILLUMINANCE, &temp_val);
 	if (ret < 0)
 		return ret;
 
-- 
2.4.3


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

* Re: [PATCH 1/1] iio:light:acpi-als: add missing prefixes
  2015-07-17 22:56 [PATCH 1/1] iio:light:acpi-als: add missing prefixes Hartmut Knaack
@ 2015-07-19  9:51 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2015-07-19  9:51 UTC (permalink / raw)
  To: Hartmut Knaack, linux-iio
  Cc: Lars-Peter Clausen, Peter Meerwald, Marek Vasut, Martin Liska,
	Gabriele Mazzotta

On 17/07/15 23:56, Hartmut Knaack wrote:
> Some macros and a function were missing the acpi_als_ prefix, so add it.
> 
> Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
Applied to the togreg branch of iio.git, initially pushed out as testing
for the autobuilders to play with it.

Thanks,

Jonathan
> ---
>  drivers/iio/light/acpi-als.c | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/iio/light/acpi-als.c b/drivers/iio/light/acpi-als.c
> index 1dafa0756bfa..60537ec0c923 100644
> --- a/drivers/iio/light/acpi-als.c
> +++ b/drivers/iio/light/acpi-als.c
> @@ -65,20 +65,20 @@ static const struct iio_chan_spec acpi_als_channels[] = {
>   * to acpi_als_channels[], the evt_buffer below will grow
>   * automatically.
>   */
> -#define EVT_NR_SOURCES		ARRAY_SIZE(acpi_als_channels)
> -#define EVT_BUFFER_SIZE		\
> -	(sizeof(s64) + (EVT_NR_SOURCES * sizeof(s32)))
> +#define ACPI_ALS_EVT_NR_SOURCES		ARRAY_SIZE(acpi_als_channels)
> +#define ACPI_ALS_EVT_BUFFER_SIZE		\
> +	(sizeof(s64) + (ACPI_ALS_EVT_NR_SOURCES * sizeof(s32)))
>  
>  struct acpi_als {
>  	struct acpi_device	*device;
>  	struct mutex		lock;
>  
> -	s32			evt_buffer[EVT_BUFFER_SIZE];
> +	s32			evt_buffer[ACPI_ALS_EVT_BUFFER_SIZE];
>  };
>  
>  /*
>   * All types of properties the ACPI0008 block can report. The ALI, ALC, ALT
> - * and ALP can all be handled by als_read_value() below, while the ALR is
> + * and ALP can all be handled by acpi_als_read_value() below, while the ALR is
>   * special.
>   *
>   * The _ALR property returns tables that can be used to fine-tune the values
> @@ -93,7 +93,7 @@ struct acpi_als {
>  #define ACPI_ALS_POLLING	"_ALP"
>  #define ACPI_ALS_TABLES		"_ALR"
>  
> -static int als_read_value(struct acpi_als *als, char *prop, s32 *val)
> +static int acpi_als_read_value(struct acpi_als *als, char *prop, s32 *val)
>  {
>  	unsigned long long temp_val;
>  	acpi_status status;
> @@ -122,11 +122,11 @@ static void acpi_als_notify(struct acpi_device *device, u32 event)
>  
>  	mutex_lock(&als->lock);
>  
> -	memset(buffer, 0, EVT_BUFFER_SIZE);
> +	memset(buffer, 0, ACPI_ALS_EVT_BUFFER_SIZE);
>  
>  	switch (event) {
>  	case ACPI_ALS_NOTIFY_ILLUMINANCE:
> -		ret = als_read_value(als, ACPI_ALS_ILLUMINANCE, &val);
> +		ret = acpi_als_read_value(als, ACPI_ALS_ILLUMINANCE, &val);
>  		if (ret < 0)
>  			goto out;
>  		*buffer++ = val;
> @@ -159,7 +159,7 @@ static int acpi_als_read_raw(struct iio_dev *indio_dev,
>  	if (chan->type != IIO_LIGHT)
>  		return -EINVAL;
>  
> -	ret = als_read_value(als, ACPI_ALS_ILLUMINANCE, &temp_val);
> +	ret = acpi_als_read_value(als, ACPI_ALS_ILLUMINANCE, &temp_val);
>  	if (ret < 0)
>  		return ret;
>  
> 


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

end of thread, other threads:[~2015-07-19  9:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-17 22:56 [PATCH 1/1] iio:light:acpi-als: add missing prefixes Hartmut Knaack
2015-07-19  9:51 ` Jonathan Cameron

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