From patchwork Wed Oct 2 11:46:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 20748 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-gg0-f197.google.com (mail-gg0-f197.google.com [209.85.161.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id F0C3D25E05 for ; Wed, 2 Oct 2013 11:46:56 +0000 (UTC) Received: by mail-gg0-f197.google.com with SMTP id l4sf621505ggi.0 for ; Wed, 02 Oct 2013 04:46:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=R8MLSJsRSvm0gHp5tAREpOBexRPRIdo4577EEY1pHTg=; b=N3NXZwvrC8icpbrikGD712/tH8WZ2tcpEwslzNwJMSnd10OxvtSLzhduiCatXjIfSr zHyvqHnE78yblYaZO53o6fO5bqNJokjUU4h67ehAvbUjE5tOEa8DRKYe3AzZ6cbiHPo5 iNcl0rjF+9TeMMptogvAQZmp9IOLGKRYxUneDAZwm5Wat1NJ2ekhZ6MLhdlZ+cw2FHbx YtDT/tsDxtw0Z57iust5Eeuqyy24goRInqr37L7/oyYT381tfQ1Tohr62MFGdt+HMIAW /cGRRIpw7ipdekKmEbNjmuyaQwbMf7+p7yrG0ok4nr8pnsS7yGFFNb0L1p14mMyDA7Yq 8Tjg== X-Received: by 10.236.34.134 with SMTP id s6mr1553768yha.49.1380714415830; Wed, 02 Oct 2013 04:46:55 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.82.49 with SMTP id f17ls459615qey.33.gmail; Wed, 02 Oct 2013 04:46:55 -0700 (PDT) X-Received: by 10.52.32.37 with SMTP id f5mr1356777vdi.17.1380714415695; Wed, 02 Oct 2013 04:46:55 -0700 (PDT) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by mx.google.com with ESMTPS id st7si227014vdc.146.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 02 Oct 2013 04:46:55 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.173 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.173; Received: by mail-vc0-f173.google.com with SMTP id if17so386989vcb.4 for ; Wed, 02 Oct 2013 04:46:55 -0700 (PDT) X-Gm-Message-State: ALoCoQltQIAedT3WmPIe8gOpCDB7F3uihXsJIOlIioWGWkHe1WATzL2FiQujtBAg7CuLXKdB/f+C X-Received: by 10.220.184.70 with SMTP id cj6mr1182211vcb.23.1380714415554; Wed, 02 Oct 2013 04:46:55 -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.220.174.196 with SMTP id u4csp89959vcz; Wed, 2 Oct 2013 04:46:55 -0700 (PDT) X-Received: by 10.14.198.197 with SMTP id v45mr3096650een.52.1380714414194; Wed, 02 Oct 2013 04:46:54 -0700 (PDT) Received: from mail-ee0-f48.google.com (mail-ee0-f48.google.com [74.125.83.48]) by mx.google.com with ESMTPS id z8si1067594eee.203.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 02 Oct 2013 04:46:54 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.83.48 is neither permitted nor denied by best guess record for domain of linus.walleij@linaro.org) client-ip=74.125.83.48; Received: by mail-ee0-f48.google.com with SMTP id l10so326953eei.7 for ; Wed, 02 Oct 2013 04:46:53 -0700 (PDT) X-Received: by 10.15.74.197 with SMTP id j45mr3038163eey.40.1380714413574; Wed, 02 Oct 2013 04:46:53 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id z12sm2963188eev.6.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 02 Oct 2013 04:46:52 -0700 (PDT) From: Linus Walleij To: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Arnd Bergmann Cc: Linus Walleij , Wolfram Sang Subject: [PATCH] misc: bh1780: probe from compatible string Date: Wed, 2 Oct 2013 13:46:47 +0200 Message-Id: <1380714407-22881-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.8.3.1 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linus.walleij@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.173 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: , Currently the BH1780GLI I2C driver relies on the device tree node having the right name, but this is fragile. Use the compatible string to probe the driver instead. Cc: Wolfram Sang Signed-off-by: Linus Walleij --- drivers/misc/bh1780gli.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/misc/bh1780gli.c b/drivers/misc/bh1780gli.c index 057580e..48ea33d 100644 --- a/drivers/misc/bh1780gli.c +++ b/drivers/misc/bh1780gli.c @@ -23,6 +23,7 @@ #include #include #include +#include #define BH1780_REG_CONTROL 0x80 #define BH1780_REG_PARTID 0x8A @@ -244,6 +245,15 @@ static const struct i2c_device_id bh1780_id[] = { { }, }; +#ifdef CONFIG_OF +static const struct of_device_id of_bh1780_match[] = { + { .compatible = "rohm,bh1780gli", }, + {}, +}; + +MODULE_DEVICE_TABLE(of, of_bh1780_match); +#endif + static struct i2c_driver bh1780_driver = { .probe = bh1780_probe, .remove = bh1780_remove, @@ -251,6 +261,7 @@ static struct i2c_driver bh1780_driver = { .driver = { .name = "bh1780", .pm = &bh1780_pm, + .of_match_table = of_match_ptr(of_bh1780_match), }, };