Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1942127imu; Sat, 12 Jan 2019 11:11:10 -0800 (PST) X-Google-Smtp-Source: ALg8bN6XWWzfzlAtQyWL8WrEIFIiKYSHJc3NuVM34A3o9a3KslEBdsEkTPZzPIbNnpBqPm1Ij+RK X-Received: by 2002:a17:902:161:: with SMTP id 88mr19988952plb.306.1547320270697; Sat, 12 Jan 2019 11:11:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547320270; cv=none; d=google.com; s=arc-20160816; b=jUx4rGmGQthIKOhvwTO1TvrZbzbxZkkcfn2u9cFk/qVMYNKVtimSJy/bZFAePLEiQg DzgCaY8HsU9rdJLdAPMw7IjIgAqKqc1bgeLuwR745iH6W4493Okj+3rCUqWoKmCxukW4 E8tyLrZeH6Bw+ti0tFVPsV6ll6sHfXWi6i1QPfGXeGOESto30omc3Zedw2LSId2sXmVw 9frTpeCVybjL0h6XTG/3AflTJqvoMXlzk6h2BIgpYT7U83uDmNze/THHl5kvAJiZVckJ HDIXLveZeCXUpX5XT+ffzWiaVzO8eXEZSEdMyJ0TshWwdpEmDr8Rm68seFOqmaRHoccP x6EA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=EfMsbw9aDC4RqvKhF6R+bFf1aBYasTBQsQtbay3oOvg=; b=FnYVaRnwCqG3SkXsfdFmcGX21QXGtzlDqDHSzL2csf/EXJ/znh9ki5gKk1wELeYqqq hZV0G0eRwC54kpJ56+2hHYeoLZX2UvvcPXMcrD+dSPgVerz/v+8DD14N6gxCrmzoTLeY m168pLzsdkmb3hco6rIuBNj1FdV7+9nrTyqwffAhVRW6nYj5eV0XXvYFT0dclGTN9T/m ItYtYR4nOL+9S7UxonMLQQ8DcJ3uouhJC0j8qVqQipfCzq1VwUaDSjLZPQfYa0IvbGzV JXirbcP8chfmb5mQN9Yzj2mOZ3f9vOGnktMq9VsLbw4hhSxT5Imk7YqOKPiKoBafwael Hesg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="eJaIC/2a"; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 26si22343543pgu.190.2019.01.12.11.10.52; Sat, 12 Jan 2019 11:11:10 -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=@kernel.org header.s=default header.b="eJaIC/2a"; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726437AbfALSW2 (ORCPT + 99 others); Sat, 12 Jan 2019 13:22:28 -0500 Received: from mail.kernel.org ([198.145.29.99]:58218 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725854AbfALSW1 (ORCPT ); Sat, 12 Jan 2019 13:22:27 -0500 Received: from archlinux (cpc91196-cmbg18-2-0-cust659.5-4.cable.virginm.net [81.96.234.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2DB0D20836; Sat, 12 Jan 2019 18:22:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547317347; bh=KTU9HeytrPIth6NO0Wfle5VKWzDAw2lsi3pguDN8ces=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=eJaIC/2au8+hSzfJggXOBJ/oTyg9/Fhm/ZxUC+ammFN8b/DHZmc7LFDppDUym++HU ZR6vQ/v/7nPU9HcKP6FNwi3YQhMRBgSqD2XrAG0wW89xLxtaW1YqOgvxZ3SUKg+iL+ xRbQZEemGK+7O0PNK7B0utCcapOvKLdDxgh2Ju00= Date: Sat, 12 Jan 2019 18:22:21 +0000 From: Jonathan Cameron To: Sebastien Bourdelin 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 Subject: Re: [PATCH v2 1/2] iio: chemical: bme680: Add device-tree support Message-ID: <20190112182221.4765d287@archlinux> In-Reply-To: <20190111205359.14158-1-sebastien.bourdelin@gmail.com> References: <20190111205359.14158-1-sebastien.bourdelin@gmail.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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... > }, > .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. > #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. > }, > .probe = bme680_spi_probe, > .id_table = bme680_spi_id,