Commit 5f348980 authored by Madhusudhan Chikkature's avatar Madhusudhan Chikkature Committed by Tony Lindgren

HDQ driver: Fix indentation and commenting style

This patch fixes the indentation, commenting style of a single line comment.
Signed-off-by: default avatarMadhusudhan Chikkature <madhu.cr@ti.com>
Acked-by: default avatarEvgeniy Polyakov <johnpol@2ka.mipt.ru>
Acked-by: default avatarFelipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 3ea07279
...@@ -77,12 +77,12 @@ static int __init omap_hdq_probe(struct platform_device *pdev); ...@@ -77,12 +77,12 @@ static int __init omap_hdq_probe(struct platform_device *pdev);
static int omap_hdq_remove(struct platform_device *pdev); static int omap_hdq_remove(struct platform_device *pdev);
static struct platform_driver omap_hdq_driver = { static struct platform_driver omap_hdq_driver = {
.probe = omap_hdq_probe, .probe = omap_hdq_probe,
.remove = omap_hdq_remove, .remove = omap_hdq_remove,
.suspend = NULL, .suspend = NULL,
.resume = NULL, .resume = NULL,
.driver = { .driver = {
.name = "omap_hdq", .name = "omap_hdq",
}, },
}; };
...@@ -100,9 +100,7 @@ static struct w1_bus_master omap_w1_master = { ...@@ -100,9 +100,7 @@ static struct w1_bus_master omap_w1_master = {
.search = omap_w1_search_bus, .search = omap_w1_search_bus,
}; };
/* /* HDQ register I/O routines */
* HDQ register I/O routines
*/
static inline u8 hdq_reg_in(struct hdq_data *hdq_data, u32 offset) static inline u8 hdq_reg_in(struct hdq_data *hdq_data, u32 offset)
{ {
return __raw_readb(hdq_data->hdq_base + offset); return __raw_readb(hdq_data->hdq_base + offset);
...@@ -161,11 +159,8 @@ static int hdq_wait_for_flag(struct hdq_data *hdq_data, u32 offset, ...@@ -161,11 +159,8 @@ static int hdq_wait_for_flag(struct hdq_data *hdq_data, u32 offset,
return ret; return ret;
} }
/* /* write out a byte and fill *status with HDQ_INT_STATUS */
* write out a byte and fill *status with HDQ_INT_STATUS static int hdq_write_byte(struct hdq_data *hdq_data, u8 val, u8 *status)
*/
static int
hdq_write_byte(struct hdq_data *hdq_data, u8 val, u8 *status)
{ {
int ret; int ret;
u8 tmp_status; u8 tmp_status;
...@@ -216,9 +211,7 @@ hdq_write_byte(struct hdq_data *hdq_data, u8 val, u8 *status) ...@@ -216,9 +211,7 @@ hdq_write_byte(struct hdq_data *hdq_data, u8 val, u8 *status)
return ret; return ret;
} }
/* /* HDQ Interrupt service routine */
* HDQ Interrupt service routine.
*/
static irqreturn_t hdq_isr(int irq, void *_hdq) static irqreturn_t hdq_isr(int irq, void *_hdq)
{ {
struct hdq_data *hdq_data = _hdq; struct hdq_data *hdq_data = _hdq;
...@@ -239,17 +232,13 @@ static irqreturn_t hdq_isr(int irq, void *_hdq) ...@@ -239,17 +232,13 @@ static irqreturn_t hdq_isr(int irq, void *_hdq)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
/* /* HDQ Mode: always return success */
* HDQ Mode: always return success.
*/
static u8 omap_w1_reset_bus(void *_hdq) static u8 omap_w1_reset_bus(void *_hdq)
{ {
return 0; return 0;
} }
/* /* W1 search callback function */
* W1 search callback function.
*/
static void omap_w1_search_bus(void *_hdq, u8 search_type, static void omap_w1_search_bus(void *_hdq, u8 search_type,
w1_slave_found_callback slave_found) w1_slave_found_callback slave_found)
{ {
...@@ -304,11 +293,8 @@ static int _omap_hdq_reset(struct hdq_data *hdq_data) ...@@ -304,11 +293,8 @@ static int _omap_hdq_reset(struct hdq_data *hdq_data)
return ret; return ret;
} }
/* /* Issue break pulse to the device */
* Issue break pulse to the device. static int omap_hdq_break(struct hdq_data *hdq_data)
*/
static int
omap_hdq_break(struct hdq_data *hdq_data)
{ {
int ret; int ret;
u8 tmp_status; u8 tmp_status;
...@@ -368,6 +354,7 @@ omap_hdq_break(struct hdq_data *hdq_data) ...@@ -368,6 +354,7 @@ omap_hdq_break(struct hdq_data *hdq_data)
"return to zero, %x", tmp_status); "return to zero, %x", tmp_status);
mutex_unlock(&hdq_data->hdq_mutex); mutex_unlock(&hdq_data->hdq_mutex);
return ret; return ret;
} }
...@@ -376,6 +363,7 @@ static int hdq_read_byte(struct hdq_data *hdq_data, u8 *val) ...@@ -376,6 +363,7 @@ static int hdq_read_byte(struct hdq_data *hdq_data, u8 *val)
int ret; int ret;
u8 status; u8 status;
unsigned long irqflags; unsigned long irqflags;
unsigned long timeout = jiffies + OMAP_HDQ_TIMEOUT;
ret = mutex_lock_interruptible(&hdq_data->hdq_mutex); ret = mutex_lock_interruptible(&hdq_data->hdq_mutex);
if (ret < 0) if (ret < 0)
...@@ -395,14 +383,11 @@ static int hdq_read_byte(struct hdq_data *hdq_data, u8 *val) ...@@ -395,14 +383,11 @@ static int hdq_read_byte(struct hdq_data *hdq_data, u8 *val)
* triggers another interrupt before we * triggers another interrupt before we
* sleep. So we have to wait for RXCOMPLETE bit. * sleep. So we have to wait for RXCOMPLETE bit.
*/ */
{ while (!(hdq_data->hdq_irqstatus
unsigned long timeout = jiffies + OMAP_HDQ_TIMEOUT; & OMAP_HDQ_INT_STATUS_RXCOMPLETE)
while (!(hdq_data->hdq_irqstatus && time_before(jiffies, timeout)) {
& OMAP_HDQ_INT_STATUS_RXCOMPLETE) set_current_state(TASK_UNINTERRUPTIBLE);
&& time_before(jiffies, timeout)) { schedule_timeout(1);
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(1);
}
} }
hdq_reg_merge(hdq_data, OMAP_HDQ_CTRL_STATUS, 0, hdq_reg_merge(hdq_data, OMAP_HDQ_CTRL_STATUS, 0,
OMAP_HDQ_CTRL_STATUS_DIR); OMAP_HDQ_CTRL_STATUS_DIR);
...@@ -425,11 +410,8 @@ static int hdq_read_byte(struct hdq_data *hdq_data, u8 *val) ...@@ -425,11 +410,8 @@ static int hdq_read_byte(struct hdq_data *hdq_data, u8 *val)
} }
/* /* Enable clocks and set the controller to HDQ mode */
* Enable clocks and set the controller to HDQ mode. static int omap_hdq_get(struct hdq_data *hdq_data)
*/
static int
omap_hdq_get(struct hdq_data *hdq_data)
{ {
int ret = 0; int ret = 0;
...@@ -479,14 +461,12 @@ omap_hdq_get(struct hdq_data *hdq_data) ...@@ -479,14 +461,12 @@ omap_hdq_get(struct hdq_data *hdq_data)
} }
} }
mutex_unlock(&hdq_data->hdq_mutex); mutex_unlock(&hdq_data->hdq_mutex);
return ret; return ret;
} }
/* /* Disable clocks to the module */
* Disable clocks to the module. static int omap_hdq_put(struct hdq_data *hdq_data)
*/
static int
omap_hdq_put(struct hdq_data *hdq_data)
{ {
int ret = 0; int ret = 0;
...@@ -507,12 +487,11 @@ omap_hdq_put(struct hdq_data *hdq_data) ...@@ -507,12 +487,11 @@ omap_hdq_put(struct hdq_data *hdq_data)
} }
} }
mutex_unlock(&hdq_data->hdq_mutex); mutex_unlock(&hdq_data->hdq_mutex);
return ret; return ret;
} }
/* /* Read a byte of data from the device */
* Read a byte of data from the device.
*/
static u8 omap_w1_read_byte(void *_hdq) static u8 omap_w1_read_byte(void *_hdq)
{ {
struct hdq_data *hdq_data = _hdq; struct hdq_data *hdq_data = _hdq;
...@@ -547,9 +526,7 @@ static u8 omap_w1_read_byte(void *_hdq) ...@@ -547,9 +526,7 @@ static u8 omap_w1_read_byte(void *_hdq)
return val; return val;
} }
/* /* Write a byte of data to the device */
* Write a byte of data to the device.
*/
static void omap_w1_write_byte(void *_hdq, u8 byte) static void omap_w1_write_byte(void *_hdq, u8 byte)
{ {
struct hdq_data *hdq_data = _hdq; struct hdq_data *hdq_data = _hdq;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment