From patchwork Thu May 9 11:08:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Baltieri X-Patchwork-Id: 16804 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f71.google.com (mail-vb0-f71.google.com [209.85.212.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CEBA9238F7 for ; Thu, 9 May 2013 11:09:09 +0000 (UTC) Received: by mail-vb0-f71.google.com with SMTP id p14sf3452644vbm.10 for ; Thu, 09 May 2013 04:08:46 -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 :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=Z3XJWFq+VyESFtYmudMSaIslT+24fUKE/fv2Sr3X4EI=; b=VogODXglKmQHCNqB/FTUIyGMpk+a62WQTJpwtvKpZ7wl0jMIM8n4FP+Hp2tAMJ7Z2T CZrakGSbI1/58DjGxdZfvAt0tQeGRbYlkXMXcAZyZB6vgK/PHzOldrLaiw6SK1HjZr4W IteuNUNwsHlScvbLBOQJ7fVCouED3vYROvNsL67Oh+8rCZawDEac9wdjSVFT9CdLSD0q jlhIJqqt5DKPDvXY0/8IOEhmf0UwJ3GqyccXAfH39F92G+yULlchCotHUJHxiEyn3jGz 3C7gcHjPWnEQNhaQgQ9E2RdeYfuIO2sGwbnrWQOv7WEeqyKvz+ycNi8Trq4r6gKz+7RJ GTgw== X-Received: by 10.224.217.195 with SMTP id hn3mr9606391qab.5.1368097726147; Thu, 09 May 2013 04:08:46 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.103.132 with SMTP id fw4ls1372447qeb.17.gmail; Thu, 09 May 2013 04:08:45 -0700 (PDT) X-Received: by 10.58.200.131 with SMTP id js3mr7464444vec.33.1368097725796; Thu, 09 May 2013 04:08:45 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id bs2si1266205veb.5.2013.05.09.04.08.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 09 May 2013 04:08:45 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.179 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.179; Received: by mail-vc0-f179.google.com with SMTP id hz10so2512658vcb.24 for ; Thu, 09 May 2013 04:08:45 -0700 (PDT) X-Received: by 10.52.175.200 with SMTP id cc8mr6346456vdc.94.1368097725700; Thu, 09 May 2013 04:08:45 -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.217.234 with SMTP id pb10csp10127vec; Thu, 9 May 2013 04:08:45 -0700 (PDT) X-Received: by 10.180.149.200 with SMTP id uc8mr28331819wib.3.1368097722670; Thu, 09 May 2013 04:08:42 -0700 (PDT) Received: from mail-we0-x22e.google.com (mail-we0-x22e.google.com [2a00:1450:400c:c03::22e]) by mx.google.com with ESMTPS id h7si1845600wiw.20.2013.05.09.04.08.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 09 May 2013 04:08:42 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c03::22e is neither permitted nor denied by best guess record for domain of fabio.baltieri@linaro.org) client-ip=2a00:1450:400c:c03::22e; Received: by mail-we0-f174.google.com with SMTP id x53so2762684wes.5 for ; Thu, 09 May 2013 04:08:42 -0700 (PDT) X-Received: by 10.194.92.231 with SMTP id cp7mr17319650wjb.3.1368097716783; Thu, 09 May 2013 04:08:36 -0700 (PDT) Received: from localhost ([2a01:2003:1:1025:8e70:5aff:feac:ad8]) by mx.google.com with ESMTPSA id q13sm3627197wie.8.2013.05.09.04.08.30 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 09 May 2013 04:08:35 -0700 (PDT) From: Fabio Baltieri To: Lee Jones , Samuel Ortiz , Linus Walleij Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Srinidhi Kasagar , Fabio Baltieri Subject: [PATCH] mfd: ab8500-sysctrl: Always enable pm_power_off handler Date: Thu, 9 May 2013 13:08:08 +0200 Message-Id: <1368097688-17858-1-git-send-email-fabio.baltieri@linaro.org> X-Mailer: git-send-email 1.8.2 X-Gm-Message-State: ALoCoQnwRzbUeVMBelx6cu40oC3EIQB4Js0YqJcKneOfW20xVVz3Lvv/UpA9ev5bgsOLdTGYlpxT X-Original-Sender: fabio.baltieri@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.179 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: , AB8500 sysctrl driver implements a pm_power_off handler, but that is currently not registered until a specific platform data field is enabled. This patch drops the platform data field and always registers ab8500_power_off if no other pm_power_off handler was defined before, and also introduces the necessary cleanup code in the driver's remove function. Signed-off-by: Fabio Baltieri --- drivers/mfd/ab8500-sysctrl.c | 6 +++++- include/linux/mfd/abx500/ab8500.h | 2 -- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/mfd/ab8500-sysctrl.c b/drivers/mfd/ab8500-sysctrl.c index eadae4d..8e0dae5 100644 --- a/drivers/mfd/ab8500-sysctrl.c +++ b/drivers/mfd/ab8500-sysctrl.c @@ -193,7 +193,7 @@ static int ab8500_sysctrl_probe(struct platform_device *pdev) sysctrl_dev = &pdev->dev; - if (plat->pm_power_off) + if (!pm_power_off) pm_power_off = ab8500_power_off; pdata = plat->sysctrl; @@ -227,6 +227,10 @@ static int ab8500_sysctrl_probe(struct platform_device *pdev) static int ab8500_sysctrl_remove(struct platform_device *pdev) { sysctrl_dev = NULL; + + if (pm_power_off == ab8500_power_off) + pm_power_off = NULL; + return 0; } diff --git a/include/linux/mfd/abx500/ab8500.h b/include/linux/mfd/abx500/ab8500.h index b5780fd..6c119b5 100644 --- a/include/linux/mfd/abx500/ab8500.h +++ b/include/linux/mfd/abx500/ab8500.h @@ -374,7 +374,6 @@ struct ab8500_sysctrl_platform_data; /** * struct ab8500_platform_data - AB8500 platform data * @irq_base: start of AB8500 IRQs, AB8500_NR_IRQS will be used - * @pm_power_off: Should machine pm power off hook be registered or not * @init: board-specific initialization after detection of ab8500 * @num_regulator_reg_init: number of regulator init registers * @regulator_reg_init: regulator init registers @@ -383,7 +382,6 @@ struct ab8500_sysctrl_platform_data; */ struct ab8500_platform_data { int irq_base; - bool pm_power_off; void (*init) (struct ab8500 *); int num_regulator_reg_init; struct ab8500_regulator_reg_init *regulator_reg_init;