Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3953046imu; Mon, 14 Jan 2019 12:04:03 -0800 (PST) X-Google-Smtp-Source: ALg8bN4ipUiLmybYpcC2O5bOctnhu7mgtxco494E74m2XWw5l2bV+6FW9RskqmgACOj4PiLe1Rkw X-Received: by 2002:a63:6cc:: with SMTP id 195mr155053pgg.401.1547496243126; Mon, 14 Jan 2019 12:04:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547496243; cv=none; d=google.com; s=arc-20160816; b=fztuyrkGClMuXHFts0yM2kFzKlbkqDOIQE5Wdf28f6Z/WQoIto/k12DDPxRAgFrmlz JyQLPyzzp8qKZhnPR64qhPDa7wlqYbqCC951z6ig0I0dzZFbH8ONeAKEVNgouiud3r+u 7dMYGjFBSbTLxIpd4SMj2zwbC2amSt2fANHaRGeg+T+98aK/Jjtlb+hyuyI2YhRNWETP LA9xK9YmnLTdIbcuW0t27+iFNl8OMUk5vP07LDiyI5gSFiYi1RXkJEo7HHbmufpSJuKT BdV904GIlA/l7vmXIyrDgp1YJ+x0rDZ+x6thIDSqGIct4w1hysaMDc4y0LsDLS0aaWsw H6JQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=2tW3xQg3wEt6J9y6OQD5MFGQ2I+uBPmHE80PtVYWtXY=; b=W0QZcIJfGfIf23cZP6VQCULebwkiiI+Rzwwo+4uv14yMHF/jCoXvf+uIfnpg1yZLmq Uav9QGsf6+nZA5NAeVq260xx2Occwv+LtaMQWUZi+Ryg6pA4mOGT/9R+j/lwzoSSv6be OZzedqHsN0Gj/C2uhE6fzEj8LeyUWvI35WfyH7ToFV9mRVt4wgZn0RdCXbX+gK5zG6nb 6faax562ck6kA8BJGS/x2WvjfBhNgjsMb9PM2jGmyia4x0lIEqzJBAGZmCiFKenwhHJX KvPrYRKTQVZHfbygnUD5lXifBppUZQ5DwHrlX7T04fAOOxmpM2z7VEPwiTU5Tp6kAovD tmmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mkqANXQf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l38si1139251plb.48.2019.01.14.12.03.46; Mon, 14 Jan 2019 12:04:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mkqANXQf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726948AbfANUCa (ORCPT + 99 others); Mon, 14 Jan 2019 15:02:30 -0500 Received: from mail-io1-f67.google.com ([209.85.166.67]:38175 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726757AbfANUC3 (ORCPT ); Mon, 14 Jan 2019 15:02:29 -0500 Received: by mail-io1-f67.google.com with SMTP id l14so231127ioj.5; Mon, 14 Jan 2019 12:02:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=2tW3xQg3wEt6J9y6OQD5MFGQ2I+uBPmHE80PtVYWtXY=; b=mkqANXQfcvP+3TaydkmNkP/TfeeVyAy5ZYQqsd/e08cItH1Xtli2ChokW0lQYCqBbf F2ljiAjjwqQyQ8HAyopNbWLBZBTLmSaVolyJYM83eoCCq63i1ODKT31qYWE2w0JXTAMC ZC2ALB7N6u4du8FgL7OE2Rvm3A2o+EMQVQjlzd6RPT/DkrMsN96v2R4yVIE8W2Tryb05 kTQEOAYxPBd5PP5RJH3p6dG798V+XFToK6ch1U8H1QNZ3L4Qq23BsGIGiG0LWVzQfgEE EshwpAxS+bVmzrCGFEpry5PHm3LiBAjwskSbYbrj3R6dux4avRx7P1BO3vRF380ZrtQv dITw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=2tW3xQg3wEt6J9y6OQD5MFGQ2I+uBPmHE80PtVYWtXY=; b=iBFWFRemLzFmeqO4y0J+pJbTloEMXhIO7aWhDrQusKB2IhQFaaUbu/SIPdB8qma+KI EHJu23Kuh6QhWcZzlQCqEn45q8FX0SNYl2Kb0WzGZYDp6e/O9zHZC2hUn1C2/i0ccISn oltFo13PUE/P/QQoS9bbeN4leFdVc6OrjJLqxD5L9cv/Y48OoiEjrQOCbN+EMEtrZh73 BI7ub7/x6DRTSOIuzHT9zBVYGTYAL+N12sDWj0yrLHbYuxbrk0Q/+yeAnR14zG+ThlB6 fWgv8+I3AVKh5fuc7h/H3D1QAdYBBb9CiaoT1ivzvLniAzMOjsSxazI4K8iG2agLvLN6 tooA== X-Gm-Message-State: AJcUukeNJ5EJlPP98U8Bv3L1jk2CP7iKaMYz1px0Z2c30dpyNRUBaXVY 7oGy3ZRBaWcoIijJoHNuwgjXXtpkdhw= X-Received: by 2002:a6b:ca04:: with SMTP id a4mr110303iog.254.1547496148295; Mon, 14 Jan 2019 12:02:28 -0800 (PST) Received: from [192.168.1.133] ([67.218.223.154]) by smtp.gmail.com with ESMTPSA id x6sm562276iol.19.2019.01.14.12.02.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 12:02:27 -0800 (PST) Subject: Re: [PATCH v2 1/2] iio: chemical: bme680: Add device-tree support To: Jonathan Cameron Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-iio@vger.kernel.org, himanshujha199640@gmail.com, mark.rutland@arm.com, robh+dt@kernel.org, pmeerw@pmeerw.net, lars@metafoo.de, knaack.h@gmx.de References: <20190111205359.14158-1-sebastien.bourdelin@gmail.com> <20190112182221.4765d287@archlinux> From: sebastien bourdelin Message-ID: <44dd6866-07fa-83cb-19d8-e35a5aa989a0@gmail.com> Date: Mon, 14 Jan 2019 15:01:41 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.3 MIME-Version: 1.0 In-Reply-To: <20190112182221.4765d287@archlinux> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 1/12/19 1:22 PM, Jonathan Cameron wrote: > On Fri, 11 Jan 2019 15:53:58 -0500 > Sebastien Bourdelin wrote: > >> This commit allow the driver to work with device-tree. >> >> Signed-off-by: Sebastien Bourdelin > Minor stuff inline. > > J >> --- >> v1 -> v2: >> - add missing of.h header in bme680_spi.c >> --- >> drivers/iio/chemical/bme680_i2c.c | 7 +++++++ >> drivers/iio/chemical/bme680_spi.c | 9 +++++++++ >> 2 files changed, 16 insertions(+) >> >> diff --git a/drivers/iio/chemical/bme680_i2c.c b/drivers/iio/chemical/bme680_i2c.c >> index 06d4be539d2e..94a36ebdf0b2 100644 >> --- a/drivers/iio/chemical/bme680_i2c.c >> +++ b/drivers/iio/chemical/bme680_i2c.c >> @@ -70,10 +70,17 @@ static const struct acpi_device_id bme680_acpi_match[] = { >> }; >> MODULE_DEVICE_TABLE(acpi, bme680_acpi_match); >> >> +static const struct of_device_id bme680_of_i2c_match[] = { >> + { .compatible = "bosch,bme680", }, >> + {}, >> +} >> +MODULE_DEVICE_TABLE(of, bme680_of_i2c_match); >> + >> static struct i2c_driver bme680_i2c_driver = { >> .driver = { >> .name = "bme680_i2c", >> .acpi_match_table = ACPI_PTR(bme680_acpi_match), >> + .of_match_table = of_match_ptr(bme680_of_i2c_match), > As below. just = bme680... Got it, thanks! > >> }, >> .probe = bme680_i2c_probe, >> .id_table = bme680_i2c_id, >> diff --git a/drivers/iio/chemical/bme680_spi.c b/drivers/iio/chemical/bme680_spi.c >> index c9fb05e8d0b9..caa57287a911 100644 >> --- a/drivers/iio/chemical/bme680_spi.c >> +++ b/drivers/iio/chemical/bme680_spi.c >> @@ -6,9 +6,11 @@ >> */ >> #include >> #include >> +#include >> #include >> #include >> >> + > This white space change should not be here. My bad. >> #include "bme680.h" >> >> static int bme680_regmap_spi_write(void *context, const void *data, >> @@ -110,10 +112,17 @@ static const struct acpi_device_id bme680_acpi_match[] = { >> }; >> MODULE_DEVICE_TABLE(acpi, bme680_acpi_match); >> >> +static const struct of_device_id bme680_of_spi_match[] = { >> + { .compatible = "bosch,bme680", }, >> + {}, >> +} >> +MODULE_DEVICE_TABLE(of, bme680_of_spi_match); >> + >> static struct spi_driver bme680_spi_driver = { >> .driver = { >> .name = "bme680_spi", >> .acpi_match_table = ACPI_PTR(bme680_acpi_match), >> + .of_match_table = of_match_ptr(bme680_of_spi_match), > Please don't use of_match_ptr. We actually want this entry to be there even > if devicetree is not in use. This is because there is a magic ACPI hid > that can use this table even from ACPI. > Sure. >> }, >> .probe = bme680_spi_probe, >> .id_table = bme680_spi_id,