From patchwork Mon Feb 2 17:14:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Grygorii.Strashko@linaro.org" X-Patchwork-Id: 44162 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 82A1D202A5 for ; Mon, 2 Feb 2015 17:14:53 +0000 (UTC) Received: by mail-wi0-f197.google.com with SMTP id n3sf20854118wiv.0 for ; Mon, 02 Feb 2015 09:14:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=RPokQvWmW+LB7DZX6//wOIoQV3diqY9s98kbsIhFOtM=; b=K6Oq/SpE2eTgsWPVvAArkk9d3W/XIKgwMGVKNwOT8DX5oKlg2GSIfo01iop3OGbvVZ u5Yl/bSfD6tP1vsGDqWf8G+qYVz/aWNMPGh4rpQdno3/opYujtFlApNTDJ6EuXPBlT71 TxeXRzzJ/kMuTfSk6OvtW4LvxJRPS0jDMJerMzn0DW6cgJ+4UHcta2FsPegv+BGlgk33 ojFk0Lh3EXbCmEJly3hH9k9fdRqNqOuvnZkhKYUtg9abhP9aeW+moe/NuBUlggBX5Fk6 1lZo01k80oUa7f3HEIEnjK84oMXaLoWCXdQ6qRLV9oiJYsEMG8Q7EbVxjIlV5UJVI6NB Kx/g== X-Gm-Message-State: ALoCoQmYKbibaAqLq2sph4AtE4SGxq4KNGwiUIPAdlIFkzks7nkwIUDdVVxeH3Gc0fv51wjr4iR0 X-Received: by 10.180.87.72 with SMTP id v8mr1393807wiz.3.1422897292366; Mon, 02 Feb 2015 09:14:52 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.43.17 with SMTP id s17ls651322lal.22.gmail; Mon, 02 Feb 2015 09:14:52 -0800 (PST) X-Received: by 10.152.42.131 with SMTP id o3mr20717780lal.43.1422897292211; Mon, 02 Feb 2015 09:14:52 -0800 (PST) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com. [209.85.215.52]) by mx.google.com with ESMTPS id aa1si17445323lbc.24.2015.02.02.09.14.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 02 Feb 2015 09:14:52 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by mail-la0-f52.google.com with SMTP id ge10so43179593lab.11 for ; Mon, 02 Feb 2015 09:14:51 -0800 (PST) X-Received: by 10.152.5.226 with SMTP id v2mr20635073lav.34.1422897291929; Mon, 02 Feb 2015 09:14:51 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp1427274lbj; Mon, 2 Feb 2015 09:14:51 -0800 (PST) X-Received: by 10.70.34.227 with SMTP id c3mr30994848pdj.97.1422897290275; Mon, 02 Feb 2015 09:14:50 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y3si2121664pdk.129.2015.02.02.09.14.49; Mon, 02 Feb 2015 09:14:50 -0800 (PST) Received-SPF: none (google.com: linux-pm-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752775AbbBBROs (ORCPT + 11 others); Mon, 2 Feb 2015 12:14:48 -0500 Received: from mail-la0-f48.google.com ([209.85.215.48]:57463 "EHLO mail-la0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752601AbbBBROr (ORCPT ); Mon, 2 Feb 2015 12:14:47 -0500 Received: by mail-la0-f48.google.com with SMTP id pv20so42995185lab.7 for ; Mon, 02 Feb 2015 09:14:46 -0800 (PST) X-Received: by 10.152.198.200 with SMTP id je8mr20311880lac.93.1422897286195; Mon, 02 Feb 2015 09:14:46 -0800 (PST) Received: from localhost ([195.238.92.128]) by mx.google.com with ESMTPSA id fb5sm4525405lbc.34.2015.02.02.09.14.45 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 02 Feb 2015 09:14:45 -0800 (PST) From: To: Jean Delvare , Guenter Roeck , lm-sensors@lm-sensors.org Cc: sumit.semwal@linaro.org, linux-arm-kernel@lists.infradead.org, , linux-pm@vger.kernel.org, Grygorii Strashko Subject: [PATCH] hwmon: tmp102: add hibernation callbacks Date: Mon, 2 Feb 2015 19:14:31 +0200 Message-Id: <1422897271-24068-1-git-send-email-grygorii.strashko@linaro.org> X-Mailer: git-send-email 1.9.1 Sender: linux-pm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: grygorii.strashko@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Grygorii Strashko Setting a dev_pm_ops suspend/resume pair but not a set of hibernation functions means those pm functions will not be called upon hibernation. Fix this by using SIMPLE_DEV_PM_OPS, which appropriately assigns the suspend and hibernation handlers. Signed-off-by: Grygorii Strashko --- drivers/hwmon/tmp102.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/hwmon/tmp102.c b/drivers/hwmon/tmp102.c index 6748b45..4f790f5 100644 --- a/drivers/hwmon/tmp102.c +++ b/drivers/hwmon/tmp102.c @@ -281,17 +281,10 @@ static int tmp102_resume(struct device *dev) config &= ~TMP102_CONF_SD; return i2c_smbus_write_word_swapped(client, TMP102_CONF_REG, config); } - -static const struct dev_pm_ops tmp102_dev_pm_ops = { - .suspend = tmp102_suspend, - .resume = tmp102_resume, -}; - -#define TMP102_DEV_PM_OPS (&tmp102_dev_pm_ops) -#else -#define TMP102_DEV_PM_OPS NULL #endif /* CONFIG_PM */ +SIMPLE_DEV_PM_OPS(tmp102_dev_pm_ops, tmp102_suspend, tmp102_resume); + static const struct i2c_device_id tmp102_id[] = { { "tmp102", 0 }, { } @@ -300,7 +293,7 @@ MODULE_DEVICE_TABLE(i2c, tmp102_id); static struct i2c_driver tmp102_driver = { .driver.name = DRIVER_NAME, - .driver.pm = TMP102_DEV_PM_OPS, + .driver.pm = &tmp102_dev_pm_ops, .probe = tmp102_probe, .remove = tmp102_remove, .id_table = tmp102_id,