From patchwork Fri May 30 10:36:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 4269591 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 5E65BBEEA7 for ; Fri, 30 May 2014 10:38:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8D38A20382 for ; Fri, 30 May 2014 10:38:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BC13C20211 for ; Fri, 30 May 2014 10:38:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932303AbaE3Kik (ORCPT ); Fri, 30 May 2014 06:38:40 -0400 Received: from mail-pd0-f171.google.com ([209.85.192.171]:64869 "EHLO mail-pd0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932170AbaE3Kij (ORCPT ); Fri, 30 May 2014 06:38:39 -0400 Received: by mail-pd0-f171.google.com with SMTP id y13so822361pdi.2 for ; Fri, 30 May 2014 03:38:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-type:content-transfer-encoding; bh=Aa573XD/AltGE4dXI3OYfpSybjY3+rpeB0WxsJBS46Q=; b=DZIZaG6l5hXmbURHYz9k6nyhJtlcVenI9MmpuEcP9VhU+96qNofUw3otNoVeqk1VFJ 2c0oAjDXETb5kLjgt28H4YcZPdQAq0HpX8wFfA+vLQSY8GfcoGYgOF+21mAdKiXjXOZ4 7yRZVFaFf+fy5t5zIA/mBd+gXgmB9/TvhIvETdNN/au865YzGB2/Ke94nU3oqp7LTUC2 JCJco9jEx8LHArhtsIhhVjqjh42Rr4HZLFCQDD/5SN818DXw58K0ebNIPg78brbaGWR8 InvOL2t9O+1muQhF+Q5D/5t9cuZw8d9AM4BKzpqV//ZJiX0rnj6zRUSKOkwxIuxWAcBC oekg== X-Gm-Message-State: ALoCoQlStFF8UZrd4UwAOPChT9rNTpTOm8UE/T5i78t+QJfeq9OQVtABCYhAK7TC0MzuvwGuFILM X-Received: by 10.66.174.199 with SMTP id bu7mr17327051pac.54.1401446318821; Fri, 30 May 2014 03:38:38 -0700 (PDT) Received: from linaro.sisodomain.com ([14.140.216.146]) by mx.google.com with ESMTPSA id eh4sm5697918pbc.79.2014.05.30.03.38.36 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 30 May 2014 03:38:38 -0700 (PDT) From: Sachin Kamat To: linux-input@vger.kernel.org Cc: dmitry.torokhov@gmail.com, sachin.kamat@linaro.org, Donggeun Kim Subject: [PATCH 1/1] Input: max8997_haptic - Check return value of regulator_enable Date: Fri, 30 May 2014 16:06:13 +0530 Message-Id: <1401446173-21981-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.9.5 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=ham 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 Fixes the following warning: drivers/input/misc/max8997_haptic.c:185:19: warning: ignoring return value of ‘regulator_enable’, declared with attribute warn_unused_result [-Wunused-result] Signed-off-by: Sachin Kamat Cc: Donggeun Kim --- drivers/input/misc/max8997_haptic.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/input/misc/max8997_haptic.c b/drivers/input/misc/max8997_haptic.c index 1fea5484941f..4f4c34e135f5 100644 --- a/drivers/input/misc/max8997_haptic.c +++ b/drivers/input/misc/max8997_haptic.c @@ -182,7 +182,11 @@ static void max8997_haptic_enable(struct max8997_haptic *chip) if (!chip->enabled) { chip->enabled = true; - regulator_enable(chip->regulator); + error = regulator_enable(chip->regulator); + if (error) { + dev_err(chip->dev, "Failed to enable regulator"); + goto out; + } max8997_haptic_configure(chip); if (chip->mode == MAX8997_EXTERNAL_MODE) pwm_enable(chip->pwm);