From patchwork Thu Jul 23 09:29:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Carikli X-Patchwork-Id: 499285 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 027A6140D2D for ; Thu, 23 Jul 2015 19:29:36 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752331AbbGWJ3e (ORCPT ); Thu, 23 Jul 2015 05:29:34 -0400 Received: from smtpfb1-g21.free.fr ([212.27.42.9]:50098 "EHLO smtpfb1-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753308AbbGWJ3Y (ORCPT ); Thu, 23 Jul 2015 05:29:24 -0400 Received: from smtp1-g21.free.fr (smtp1-g21.free.fr [212.27.42.1]) by smtpfb1-g21.free.fr (Postfix) with ESMTP id 112DD77D656 for ; Thu, 23 Jul 2015 11:29:19 +0200 (CEST) Received: from denis-N73SV.local.eukrea.fr (unknown [88.170.243.169]) by smtp1-g21.free.fr (Postfix) with ESMTP id 9468D9400A0; Thu, 23 Jul 2015 11:29:17 +0200 (CEST) From: Denis Carikli To: Wolfram Sang Cc: =?UTF-8?q?Eric=20B=C3=A9nard?= , linux-i2c@vger.kernel.org, linux@roeck-us.net, Denis Carikli Subject: [PATCH 1/3] hwmon: lm92: Add devicetree support Date: Thu, 23 Jul 2015 11:29:08 +0200 Message-Id: <1437643748-11677-1-git-send-email-denis@eukrea.com> X-Mailer: git-send-email 2.4.5 Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org Signed-off-by: Denis Carikli --- drivers/hwmon/lm92.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/hwmon/lm92.c b/drivers/hwmon/lm92.c index cfaf70b..a1e10cd 100644 --- a/drivers/hwmon/lm92.c +++ b/drivers/hwmon/lm92.c @@ -44,6 +44,7 @@ #include #include #include +#include #include /* @@ -386,6 +387,13 @@ static int lm92_probe(struct i2c_client *new_client, * Module and driver stuff */ +#ifdef CONFIG_OF +static const struct of_device_id lm92_of_match[] = { + { .compatible = "national,lm92", }, +}; +MODULE_DEVICE_TABLE(of, lm92_of_match); +#endif + static const struct i2c_device_id lm92_id[] = { { "lm92", 0 }, /* max6635 could be added here */ @@ -397,6 +405,7 @@ static struct i2c_driver lm92_driver = { .class = I2C_CLASS_HWMON, .driver = { .name = "lm92", + .of_match_table = of_match_ptr(lm92_of_match), }, .probe = lm92_probe, .id_table = lm92_id,