[9609][WING] sensor: sar: fix build error by unused variable
authorYoungmin Nam <youngmin.nam@samsung.com>
Tue, 7 Aug 2018 04:50:04 +0000 (13:50 +0900)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:23:42 +0000 (20:23 +0300)
Change-Id: I9c5c99de8db8cd6ebacac27ed01e17a892940b27
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
drivers/input/misc/sx932x.c

index d94b4386c1908ea34efcfe465f8ce13e3fa90219..ea499002dd8d6303b6190875c03b0500f336b2cb 100755 (executable)
@@ -1,7 +1,7 @@
 /*! \file sx932x.c\r
  * \brief  SX9320 Driver\r
  *\r
- * Driver for the SX9320 \r
+ * Driver for the SX9320\r
  * Copyright (c) 2011 Semtech Corp\r
  *\r
  *  This program is free software; you can redistribute it and/or modify\r
@@ -25,7 +25,7 @@
 #include <linux/syscalls.h>\r
 #include <linux/wakelock.h>\r
 #include <linux/uaccess.h>\r
-#include <linux/sort.h> \r
+#include <linux/sort.h>\r
 #include <linux/gpio.h>\r
 #include <linux/of_gpio.h>\r
 #include <linux/regulator/consumer.h>\r
@@ -68,7 +68,7 @@ static int irq_gpio_num;
 \r
 /*! \fn static int write_register(psx93XX_t this, u8 address, u8 value)\r
  * \brief Sends a write register to the device\r
- * \param this Pointer to main parent struct \r
+ * \param this Pointer to main parent struct\r
  * \param address 8-bit register address\r
  * \param value   8-bit register value to write to address\r
  * \return Value from i2c_master_send\r
@@ -95,11 +95,11 @@ static int write_register(psx93XX_t this, u8 address, u8 value)
        return returnValue;\r
 }\r
 \r
-/*! \fn static int read_register(psx93XX_t this, u8 address, u8 *value) \r
+/*! \fn static int read_register(psx93XX_t this, u8 address, u8 *value)\r
 * \brief Reads a register's value from the device\r
-* \param this Pointer to main parent struct \r
+* \param this Pointer to main parent struct\r
 * \param address 8-Bit address to read from\r
-* \param value Pointer to 8-bit value to save register value to \r
+* \param value Pointer to 8-bit value to save register value to\r
 * \return Value from i2c_smbus_read_byte_data if < 0. else 0\r
 */\r
 static int read_register(psx93XX_t this, u8 address, u8 *value)\r
@@ -112,7 +112,7 @@ static int read_register(psx93XX_t this, u8 address, u8 *value)
                dev_info(&i2c->dev, "read_register Address:i2c:%s 0x%x Return: 0x%x\n",this->bus,\r
                                                                                                                address,returnValue);\r
                returnValue = i2c_smbus_read_byte_data(i2c,address);\r
-               \r
+\r
                #ifdef DEBUG\r
                dev_info(&i2c->dev, "read_register Address: 0x%x Return: 0x%x\n",\r
                                                                                                                address,returnValue);\r
@@ -121,7 +121,7 @@ static int read_register(psx93XX_t this, u8 address, u8 *value)
                if (returnValue >= 0) {\r
                        *value = returnValue;\r
                        return 0;\r
-               } \r
+               }\r
                else {\r
                        return returnValue;\r
                }\r
@@ -134,9 +134,9 @@ static int read_register(psx93XX_t this, u8 address, u8 *value)
 /*! \fn static int read_regStat(psx93XX_t this)\r
  * \brief Shortcut to read what caused interrupt.\r
  * \details This is to keep the drivers a unified\r
- * function that will read whatever register(s) \r
+ * function that will read whatever register(s)\r
  * provide information on why the interrupt was caused.\r
- * \param this Pointer to main parent struct \r
+ * \param this Pointer to main parent struct\r
  * \return If successful, Value of bit(s) that cause interrupt, else 0\r
  */\r
 static int read_regStat(psx93XX_t this)\r
@@ -196,7 +196,7 @@ static int sx932x_Hardware_Check(psx93XX_t this)
        u8 failcode;\r
        u8 loop = 0;\r
        this->failStatusCode = 0;\r
-       \r
+\r
        //Check th IRQ Status\r
        while(this->get_nirq_low && this->get_nirq_low()){\r
                read_regStat(this);\r
@@ -206,17 +206,17 @@ static int sx932x_Hardware_Check(psx93XX_t this)
                        break;\r
                }\r
        }\r
-       \r
+\r
        //Check I2C Connection\r
        ret = read_register(this, SX932x_WHOAMI_REG, &failcode);\r
        if(ret < 0){\r
                this->failStatusCode = SX932x_I2C_ERROR;\r
        }\r
-               \r
+\r
        if(failcode!= SX932x_WHOAMI_VALUE){\r
                this->failStatusCode = SX932x_ID_ERROR;\r
        }\r
-       \r
+\r
        dev_info(this->pdev, "sx932x failcode = 0x%x\n",this->failStatusCode);\r
        return (int)this->failStatusCode;\r
 }\r
@@ -292,19 +292,19 @@ static void read_rawData(psx93XX_t this)
        u16 offset;\r
        if(this){\r
                for(csx =0; csx<4; csx++){\r
-                       write_register(this,SX932x_CPSRD,csx);//here to check the CS1, also can read other channel              \r
+                       write_register(this,SX932x_CPSRD,csx);//here to check the CS1, also can read other channel\r
                        read_register(this,SX932x_USEMSB,&msb);\r
                        read_register(this,SX932x_USELSB,&lsb);\r
                        useful = (s32)((msb << 8) | lsb);\r
-                       \r
+\r
                        read_register(this,SX932x_AVGMSB,&msb);\r
                        read_register(this,SX932x_AVGLSB,&lsb);\r
                        average = (s32)((msb << 8) | lsb);\r
-                       \r
+\r
                        read_register(this,SX932x_DIFFMSB,&msb);\r
                        read_register(this,SX932x_DIFFLSB,&lsb);\r
                        diff = (s32)((msb << 8) | lsb);\r
-                       \r
+\r
                        read_register(this,SX932x_OFFSETMSB,&msb);\r
                        read_register(this,SX932x_OFFSETLSB,&lsb);\r
                        offset = (u16)((msb << 8) | lsb);\r
@@ -351,7 +351,7 @@ static void sx932x_reg_init(psx93XX_t this)
        psx932x_t pDevice = 0;\r
        psx932x_platform_data_t pdata = 0;\r
        int i = 0;\r
-       /* configure device */ \r
+       /* configure device */\r
        dev_info(this->pdev, "Going to Setup I2C Registers\n");\r
        if (this && (pDevice = this->pDevice) && (pdata = pDevice->hw))\r
        {\r
@@ -385,7 +385,7 @@ static void sx932x_reg_init(psx93XX_t this)
 \r
 /*! \fn static int initialize(psx93XX_t this)\r
  * \brief Performs all initialization needed to configure the device\r
- * \param this Pointer to main parent struct \r
+ * \param this Pointer to main parent struct\r
  * \return Last used command's return value (negative if error)\r
  */\r
 static int initialize(psx93XX_t this)\r
@@ -402,16 +402,16 @@ static int initialize(psx93XX_t this)
                dev_info(this->pdev, "Sent Software Reset. Waiting until device is back from reset to continue.\n");\r
                /* just sleep for awhile instead of using a loop with reading irq status */\r
                msleep(100);\r
-               \r
+\r
                ret = sx932x_global_variable_init(this);\r
-               \r
+\r
                sx932x_reg_init(this);\r
                msleep(100); /* make sure everything is running */\r
                manual_offset_calibration(this);\r
 \r
                /* re-enable interrupt handling */\r
                enable_irq(this->irq);\r
-               \r
+\r
                /* make sure no interrupts are pending since enabling irq will only\r
                * work on next falling edge */\r
                read_regStat(this);\r
@@ -420,9 +420,9 @@ static int initialize(psx93XX_t this)
        return -ENOMEM;\r
 }\r
 \r
-/*! \r
+/*!\r
  * \brief Handle what to do when a touch occurs\r
- * \param this Pointer to main parent struct \r
+ * \param this Pointer to main parent struct\r
  */\r
 static void touchProcess(psx93XX_t this)\r
 {\r
@@ -490,10 +490,9 @@ static int sx932x_parse_dt(struct sx932x_platform_data *pdata, struct device *de
 {\r
        struct device_node *dNode = dev->of_node;\r
        enum of_gpio_flags flags;\r
-       int ret;\r
        if (dNode == NULL)\r
                return -ENODEV;\r
-       \r
+\r
        pdata->irq_gpio= of_get_named_gpio_flags(dNode,\r
                                                                                        "Semtech,nirq-gpio", 0, &flags);\r
        irq_gpio_num = pdata->irq_gpio;\r
@@ -501,7 +500,7 @@ static int sx932x_parse_dt(struct sx932x_platform_data *pdata, struct device *de
                pr_err("[SENSOR]: %s - get irq_gpio error\n", __func__);\r
                return -ENODEV;\r
        }\r
-       \r
+\r
        /***********************************************************************/\r
        // load in registers from device tree\r
        of_property_read_u32(dNode,"Semtech,reg-num",&pdata->i2c_reg_num);\r
@@ -548,7 +547,7 @@ static int sx932x_init_platform_hw(struct i2c_client *client)
                                return rc;\r
                        }\r
                        pinctrl_int = devm_pinctrl_get_select(this->pdev, "default");\r
-                       \r
+\r
                        this->irq = client->irq = gpio_to_irq(pdata->irq_gpio);\r
                }\r
                else {\r
@@ -558,7 +557,7 @@ static int sx932x_init_platform_hw(struct i2c_client *client)
        else {\r
                pr_err("[SX9320] : %s - Do not init platform HW", __func__);\r
        }\r
-       \r
+\r
        pr_err("[SX9320]: %s - sx9320_irq_debug\n",__func__);\r
        return rc;\r
 }\r
@@ -592,12 +591,10 @@ static int sx932x_get_nirq_state(void)
  * \return Whether probe was successful\r
  */\r
 static int sx932x_probe(struct i2c_client *client, const struct i2c_device_id *id)\r
-{    \r
+{\r
        int i = 0;\r
        int err = 0;\r
        int ret = 0;\r
-       u8 data1 = 0;\r
-       int  q = 0;\r
        psx93XX_t this = 0;\r
        psx932x_t pDevice = 0;\r
        psx932x_platform_data_t pplatData = 0;\r
@@ -654,8 +651,8 @@ static int sx932x_probe(struct i2c_client *client, const struct i2c_device_id *i
        }\r
        pplatData->get_is_nirq_low = sx932x_get_nirq_state;\r
        pplatData->pbuttonInformation = pButtonInformationData;\r
\r
-       client->dev.platform_data = pplatData; \r
+\r
+       client->dev.platform_data = pplatData;\r
        err = sx932x_parse_dt(pplatData, &client->dev);\r
        if (err) {\r
                dev_err(&client->dev, "could not setup pin\n");\r
@@ -664,15 +661,15 @@ static int sx932x_probe(struct i2c_client *client, const struct i2c_device_id *i
 \r
        pplatData->init_platform_hw = sx932x_init_platform_hw;\r
        dev_err(&client->dev, "SX9320 init_platform_hw done!\n");\r
-       \r
+\r
        if (this){\r
                dev_info(&client->dev, "SX9320 initialize start!!");\r
-               /* In case we need to reinitialize data \r
+               /* In case we need to reinitialize data\r
                * (e.q. if suspend reset device) */\r
                this->init = initialize;\r
                /* shortcut to read status of interrupt */\r
                this->refreshStatus = read_regStat;\r
-               /* pointer to function from platform data to get pendown \r
+               /* pointer to function from platform data to get pendown\r
                * (1->NIRQ=0, 0->NIRQ=1) */\r
                this->get_nirq_low = pplatData->get_is_nirq_low;\r
                /* save irq in case we need to reference it */\r
@@ -905,7 +902,7 @@ static void sx93XX_worker_func(struct work_struct *work)
                status = this->refreshStatus(this);\r
                counter = -1;\r
                dev_dbg(this->pdev, "Worker - Refresh Status %d\n",status);\r
-               \r
+\r
                while((++counter) < MAX_NUM_STATUS_BITS) { /* counter start from MSB */\r
                        if (((status>>counter) & 0x01) && (this->statusFunc[counter])) {\r
                                dev_info(this->pdev, "SX9320 Function Pointer Found. Calling\n");\r