From patchwork Fri Jan 24 00:00:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Courtney Cavin X-Patchwork-Id: 3532541 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9B3DAC02DD for ; Fri, 24 Jan 2014 00:00:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EB17F20181 for ; Fri, 24 Jan 2014 00:00:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 02B0B201BB for ; Fri, 24 Jan 2014 00:00:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755587AbaAXAAI (ORCPT ); Thu, 23 Jan 2014 19:00:08 -0500 Received: from seldrel01.sonyericsson.com ([212.209.106.2]:19874 "EHLO seldrel01.sonyericsson.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755578AbaAXAAH (ORCPT ); Thu, 23 Jan 2014 19:00:07 -0500 From: Courtney Cavin To: CC: , Subject: [PATCH 14/15] Input: synaptics-rmi4 - ensure we have IRQs before reading status Date: Thu, 23 Jan 2014 16:00:22 -0800 Message-ID: <1390521623-6491-15-git-send-email-courtney.cavin@sonymobile.com> X-Mailer: git-send-email 1.8.1.5 In-Reply-To: <1390521623-6491-14-git-send-email-courtney.cavin@sonymobile.com> References: <1390521623-6491-1-git-send-email-courtney.cavin@sonymobile.com> <1390521623-6491-2-git-send-email-courtney.cavin@sonymobile.com> <1390521623-6491-3-git-send-email-courtney.cavin@sonymobile.com> <1390521623-6491-4-git-send-email-courtney.cavin@sonymobile.com> <1390521623-6491-5-git-send-email-courtney.cavin@sonymobile.com> <1390521623-6491-6-git-send-email-courtney.cavin@sonymobile.com> <1390521623-6491-7-git-send-email-courtney.cavin@sonymobile.com> <1390521623-6491-8-git-send-email-courtney.cavin@sonymobile.com> <1390521623-6491-9-git-send-email-courtney.cavin@sonymobile.com> <1390521623-6491-10-git-send-email-courtney.cavin@sonymobile.com> <1390521623-6491-11-git-send-email-courtney.cavin@sonymobile.com> <1390521623-6491-12-git-send-email-courtney.cavin@sonymobile.com> <1390521623-6491-13-git-send-email-courtney.cavin@sonymobile.com> <1390521623-6491-14-git-send-email-courtney.cavin@sonymobile.com> MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Cc: Christopher Heiny Cc: Dmitry Torokhov Signed-off-by: Courtney Cavin --- drivers/input/rmi4/rmi_f01.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/input/rmi4/rmi_f01.c b/drivers/input/rmi4/rmi_f01.c index 22b57f2..06fc5bc 100644 --- a/drivers/input/rmi4/rmi_f01.c +++ b/drivers/input/rmi4/rmi_f01.c @@ -318,13 +318,15 @@ static int rmi_f01_initialize(struct rmi_function *fn) ctrl_base_addr += sizeof(u8); data->interrupt_enable_addr = ctrl_base_addr; - error = rmi_read_block(rmi_dev, ctrl_base_addr, - data->device_control.interrupt_enable, - sizeof(u8) * (data->num_of_irq_regs)); - if (error < 0) { - dev_err(&fn->dev, - "Failed to read F01 control interrupt enable register.\n"); - goto error_exit; + if (data->num_of_irq_regs > 0) { + error = rmi_read_block(rmi_dev, ctrl_base_addr, + data->device_control.interrupt_enable, + sizeof(u8) * (data->num_of_irq_regs)); + if (error < 0) { + dev_err(&fn->dev, + "Failed to read F01 control interrupt enable register.\n"); + goto error_exit; + } } ctrl_base_addr += data->num_of_irq_regs;