From patchwork Fri Apr 26 12:17:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Baltieri X-Patchwork-Id: 16426 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f199.google.com (mail-qc0-f199.google.com [209.85.216.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 128EB2397A for ; Fri, 26 Apr 2013 12:19:20 +0000 (UTC) Received: by mail-qc0-f199.google.com with SMTP id p7sf5921081qcq.10 for ; Fri, 26 Apr 2013 05:18:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=Xe24so4FCdSFOYbbk4P9Pur0Mm9S5eh6HzI8WaxbDRI=; b=ERbHGSlFwhid/TEhKq/BYZzS2wpS/zOioNcysvJVOO91RhF6zqA62bHsRVpxLvCBY4 wYSx0RNmyHRphxxWoRZnL92yi8y1gO4N6T+5eRDk+tXskGl9jJMnvzf/IfdBkHXI8oTo AGwYx4kjcCn3toHJLCv9TZpt21K/YAoGd+dvuk/BBAUf2bVCOsPUogDUmZ+cR4fmIghJ 5hTUvq5AtykQ9EhMqWkgpDYiXYaah93fd9XPwItPLntVemjqU0HSoBQ8qc3vDDAF1E05 2CJoLKXuTnJRO9N/HWBiTLkc3EFsD72b5OqTveK8gM/Z3q0kM23E36T1aK62ps3LscPm bYnw== X-Received: by 10.58.75.17 with SMTP id y17mr14733916vev.26.1366978704434; Fri, 26 Apr 2013 05:18:24 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.118.106 with SMTP id kl10ls1841822qeb.34.gmail; Fri, 26 Apr 2013 05:18:24 -0700 (PDT) X-Received: by 10.52.67.166 with SMTP id o6mr24288122vdt.59.1366978704219; Fri, 26 Apr 2013 05:18:24 -0700 (PDT) Received: from mail-vb0-x232.google.com (mail-vb0-x232.google.com [2607:f8b0:400c:c02::232]) by mx.google.com with ESMTPS id sa4si5222187vdc.153.2013.04.26.05.18.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 26 Apr 2013 05:18:24 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::232 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c02::232; Received: by mail-vb0-f50.google.com with SMTP id w16so3509582vbb.37 for ; Fri, 26 Apr 2013 05:18:24 -0700 (PDT) X-Received: by 10.52.166.103 with SMTP id zf7mr24722260vdb.94.1366978704028; Fri, 26 Apr 2013 05:18:24 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.127.98 with SMTP id nf2csp66050veb; Fri, 26 Apr 2013 05:18:23 -0700 (PDT) X-Received: by 10.204.172.80 with SMTP id k16mr18662922bkz.123.1366978702993; Fri, 26 Apr 2013 05:18:22 -0700 (PDT) Received: from mail-bk0-x231.google.com (mail-bk0-x231.google.com [2a00:1450:4008:c01::231]) by mx.google.com with ESMTPS id x3si3842909bkh.101.2013.04.26.05.18.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 26 Apr 2013 05:18:22 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:4008:c01::231 is neither permitted nor denied by best guess record for domain of fabio.baltieri@linaro.org) client-ip=2a00:1450:4008:c01::231; Received: by mail-bk0-f49.google.com with SMTP id w5so1727511bku.22 for ; Fri, 26 Apr 2013 05:18:22 -0700 (PDT) X-Received: by 10.205.104.8 with SMTP id dk8mr18349713bkc.34.1366978702250; Fri, 26 Apr 2013 05:18:22 -0700 (PDT) Received: from localhost ([2a01:2003:1:1f50:8e70:5aff:feac:ad8]) by mx.google.com with ESMTPSA id x18sm3142544bkw.4.2013.04.26.05.18.16 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 26 Apr 2013 05:18:21 -0700 (PDT) From: Fabio Baltieri To: Samuel Ortiz Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Lee Jones , Linus Walleij , Srinidhi Kasagar , Fabio Baltieri Subject: [PATCH 5/5] mfd: ab8500-sysctrl: let sysctrl driver work without pdata Date: Fri, 26 Apr 2013 14:17:18 +0200 Message-Id: <1366978638-967-6-git-send-email-fabio.baltieri@linaro.org> X-Mailer: git-send-email 1.8.1.3 In-Reply-To: <1366978638-967-1-git-send-email-fabio.baltieri@linaro.org> References: <1366978638-967-1-git-send-email-fabio.baltieri@linaro.org> X-Gm-Message-State: ALoCoQm5WvhVCXXJkA8JN3vdCLdqGBhZcDxD9hwjqE/Fkj2Wxipz//Is9cJ2zEgM1ie4iidr8I/d X-Original-Sender: fabio.baltieri@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::232 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , A check for a valid plat->sysctrl was introduced in: 2377e52 mfd: ab8500-sysctrl: Error check clean up but the driver works just fine even without that initialization data. This patch removes the check and let the driver go ahead with probe. Signed-off-by: Fabio Baltieri --- drivers/mfd/ab8500-sysctrl.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/mfd/ab8500-sysctrl.c b/drivers/mfd/ab8500-sysctrl.c index b851692..eadae4d 100644 --- a/drivers/mfd/ab8500-sysctrl.c +++ b/drivers/mfd/ab8500-sysctrl.c @@ -104,7 +104,7 @@ void ab8500_restart(char mode, const char *cmd) plat = dev_get_platdata(sysctrl_dev->parent); pdata = plat->sysctrl; - if (pdata->reboot_reason_code) + if (pdata && pdata->reboot_reason_code) reason = pdata->reboot_reason_code(cmd); else pr_warn("[%s] No reboot reason set. Default reason %d\n", @@ -188,7 +188,7 @@ static int ab8500_sysctrl_probe(struct platform_device *pdev) plat = dev_get_platdata(pdev->dev.parent); - if (!(plat && plat->sysctrl)) + if (!plat) return -EINVAL; sysctrl_dev = &pdev->dev; @@ -197,7 +197,6 @@ static int ab8500_sysctrl_probe(struct platform_device *pdev) pm_power_off = ab8500_power_off; pdata = plat->sysctrl; - if (pdata) { int last, ret, i, j;