From patchwork Fri Feb 15 12:56:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 2147571 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id E85353FCF6 for ; Fri, 15 Feb 2013 13:14:28 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U6L4k-0003kL-DH; Fri, 15 Feb 2013 13:11:38 +0000 Received: from mail-we0-x234.google.com ([2a00:1450:400c:c03::234]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1U6Kr0-0007jO-HN for linux-arm-kernel@lists.infradead.org; Fri, 15 Feb 2013 12:57:27 +0000 Received: by mail-we0-f180.google.com with SMTP id k14so2773006wer.39 for ; Fri, 15 Feb 2013 04:57:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=g4IOQzF+RNpJaZxSIlZnOr2284Sco5dfN4gBhJVq150=; b=iNAykSbhoMUO+Or5cBwjj1Khya1Fjy2ALdRH5kMWcEKCaJym+/QueNF/JH3+SSZeY/ PluSjwRs8FXVMHAAVrTYlD8Ghtw/hQhaHn2XrE7oaZyiKb8a5sQTSZckgvJL3MJdvBKP jqFNSFu33+RYf6nlQTlJDmaAWYjKdHQuoI1uSEJeZQyEvFmQfIAuig2BByE+2AaJvuTa Cdgy3lc/rPgW8Avq0QGTfPJQI6AIWN4WKUnT1XYx3lqPaIdRqjLft4ndcMU1+IvlocdQ q0wltkHOkDdRZwK+xZKlY2yZ1O8jcHqz6vlXM/gfrRdCWj7AseN51iPCFbfGPv8cCqHZ E3dA== X-Received: by 10.194.121.38 with SMTP id lh6mr3608690wjb.27.1360933044619; Fri, 15 Feb 2013 04:57:24 -0800 (PST) Received: from localhost.localdomain (cpc34-aztw25-2-0-cust250.18-1.cable.virginmedia.com. [86.16.136.251]) by mx.google.com with ESMTPS id j4sm2852410wiz.10.2013.02.15.04.57.22 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 15 Feb 2013 04:57:23 -0800 (PST) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, sameo@linux.intel.com Subject: [PATCH 02/35] mfd: ab8500-gpadc: Allow tvout regulator to be missing Date: Fri, 15 Feb 2013 12:56:33 +0000 Message-Id: <1360933026-30325-3-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1360933026-30325-1-git-send-email-lee.jones@linaro.org> References: <1360933026-30325-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQmcfsxwd2cMWTQR52+0NOVfeYlOIjp0Gaqe2qg6I2r8wySoqha1PeTkoxEncIWCS1rwagKj X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130215_075726_713532_9DC7F3DE X-CRM114-Status: GOOD ( 11.49 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Jonas Aaberg , linus.walleij@stericsson.com, arnd@arndb.de X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Jonas Aaberg Signed-off-by: Jonas Aaberg Signed-off-by: Lee Jones dev))) return gpadc; @@ -587,7 +590,8 @@ static int ab8500_gpadc_runtime_suspend(struct device *dev) { struct ab8500_gpadc *gpadc = dev_get_drvdata(dev); - regulator_disable(gpadc->regu); + if (gpadc->regu) + regulator_disable(gpadc->regu); return 0; } @@ -595,7 +599,8 @@ static int ab8500_gpadc_runtime_resume(struct device *dev) { struct ab8500_gpadc *gpadc = dev_get_drvdata(dev); - regulator_enable(gpadc->regu); + if (gpadc->regu) + regulator_enable(gpadc->regu); return 0; } @@ -670,9 +675,8 @@ static int ab8500_gpadc_probe(struct platform_device *pdev) /* VTVout LDO used to power up ab8500-GPADC */ gpadc->regu = regulator_get(&pdev->dev, "vddadc"); if (IS_ERR(gpadc->regu)) { - ret = PTR_ERR(gpadc->regu); - dev_err(gpadc->dev, "failed to get vtvout LDO\n"); - goto fail_irq; + dev_warn(gpadc->dev, "failed to get vtvout LDO\n"); + gpadc->regu = NULL; } platform_set_drvdata(pdev, gpadc); @@ -688,8 +692,6 @@ static int ab8500_gpadc_probe(struct platform_device *pdev) list_add_tail(&gpadc->node, &ab8500_gpadc_list); dev_dbg(gpadc->dev, "probe success\n"); return 0; -fail_irq: - free_irq(gpadc->irq, gpadc); fail: kfree(gpadc); gpadc = NULL; @@ -708,7 +710,8 @@ static int ab8500_gpadc_remove(struct platform_device *pdev) pm_runtime_get_sync(gpadc->dev); pm_runtime_disable(gpadc->dev); - regulator_disable(gpadc->regu); + if (gpadc->regu) + regulator_disable(gpadc->regu); pm_runtime_set_suspended(gpadc->dev);