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: 14887 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id A8C8D23E01 for ; Fri, 15 Feb 2013 12:57:26 +0000 (UTC) Received: from mail-ve0-f181.google.com (mail-ve0-f181.google.com [209.85.128.181]) by fiordland.canonical.com (Postfix) with ESMTP id 5B785A1844A for ; Fri, 15 Feb 2013 12:57:26 +0000 (UTC) Received: by mail-ve0-f181.google.com with SMTP id d10so2921240vea.26 for ; Fri, 15 Feb 2013 04:57:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=g4IOQzF+RNpJaZxSIlZnOr2284Sco5dfN4gBhJVq150=; b=QuYxtWC3lB3E20mYPaLiWbe1IHbHz4NdY57Fsa+Urfq5cSq+7ThKLeiFqRgdnEwFa8 myc3+zXYOsT+peEexMc+lGHvpg30QmJ3aa+w7iX0SdGvW8spp8eC8LGTtEEaRH2cv08p iOwhwUmTUlqXj0tGf8Zt3XrwndF3kDrCVZ8U2p77QQ/Z1w2bdbdf06g6oinf6FGVBH+n KRpiwijr+QYBMgqylxkIZsZFmC1AMZM7MayrB9tBDPOfi0zMm+CEdwVXzRt365GFDErw dtkynCB7fEO78qvNpFRsfXQPyn8qvUc+LDoYdQkhGeTXy/sPHCdSV1lb7/t/n88Vi2iu bN1Q== X-Received: by 10.52.33.167 with SMTP id s7mr2543667vdi.52.1360933045875; Fri, 15 Feb 2013 04:57:25 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.221.4.5 with SMTP id oa5csp11353vcb; Fri, 15 Feb 2013 04:57:25 -0800 (PST) X-Received: by 10.194.88.202 with SMTP id bi10mr4147729wjb.5.1360933045052; Fri, 15 Feb 2013 04:57:25 -0800 (PST) Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com [209.85.212.175]) by mx.google.com with ESMTPS id j10si1045480wiv.83.2013.02.15.04.57.24 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 15 Feb 2013 04:57:25 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.175 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=209.85.212.175; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.175 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) smtp.mail=lee.jones@linaro.org Received: by mail-wi0-f175.google.com with SMTP id l13so1113604wie.2 for ; Fri, 15 Feb 2013 04:57:24 -0800 (PST) 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 Cc: arnd@arndb.de, linus.walleij@stericsson.com, Jonas Aaberg 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: ALoCoQnBktC9MIqVY6l+hh1UBMdEtywA7hdCxqKdHgZTQcsILTUnkaBw9LcqtJMTPCz0itnRxq1s 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);