diff options
author | Xi Wang <xi.wang@gmail.com> | 2011-12-02 21:28:43 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-12-08 23:00:43 (GMT) |
commit | 91762057f439bb0adb33ca857b6022fda4b1fd69 (patch) | |
tree | f6f3d6db213eac30f3dc6c990812bf6e7365ccee /drivers/staging/olpc_dcon/olpc_dcon_xo_1_5.c | |
parent | fb927284e4d3a0c50a47063ff9be1fe3f5511f61 (diff) | |
download | linux-fsl-qoriq-91762057f439bb0adb33ca857b6022fda4b1fd69.tar.xz |
staging: olpc_dcon: ->read_status() API change
Change ->read_status() by separating the error handling and the
status bits. This also fixes a signedness bug in dcon_interrupt()
that would break the error handling.
Signed-off-by: Xi Wang <xi.wang@gmail.com>
Acked-by: Andres Salomon <dilinger@queued.net>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/olpc_dcon/olpc_dcon_xo_1_5.c')
-rw-r--r-- | drivers/staging/olpc_dcon/olpc_dcon_xo_1_5.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/staging/olpc_dcon/olpc_dcon_xo_1_5.c b/drivers/staging/olpc_dcon/olpc_dcon_xo_1_5.c index a6a6cf2..69415ee 100644 --- a/drivers/staging/olpc_dcon/olpc_dcon_xo_1_5.c +++ b/drivers/staging/olpc_dcon/olpc_dcon_xo_1_5.c @@ -167,20 +167,18 @@ static void dcon_set_dconload_xo_1_5(int val) gpio_set_value(VX855_GPIO(1), val); } -static u8 dcon_read_status_xo_1_5(void) +static int dcon_read_status_xo_1_5(u8 *status) { - u8 status; - if (!dcon_was_irq()) return -1; /* i believe this is the same as "inb(0x44b) & 3" */ - status = gpio_get_value(VX855_GPI(10)); - status |= gpio_get_value(VX855_GPI(11)) << 1; + *status = gpio_get_value(VX855_GPI(10)); + *status |= gpio_get_value(VX855_GPI(11)) << 1; dcon_clear_irq(); - return status; + return 0; } struct dcon_platform_data dcon_pdata_xo_1_5 = { |