Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10461435ybi; Thu, 11 Jul 2019 05:45:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqwuDU0tKUydxaYa0eMtMn0YsKULGQ8dBSDBgvvXSKw1bC97dxhnchdCGJgWUEtPNqTfpNFd X-Received: by 2002:a63:9a51:: with SMTP id e17mr4343740pgo.212.1562849106128; Thu, 11 Jul 2019 05:45:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562849106; cv=none; d=google.com; s=arc-20160816; b=vovgLfvrtypWeJuD7cvLEByu7ldezcAmmSxrRh4lXoUvEoktHNI7x43ZhyolTn+Zvs 0e2jFQJcBPDoGhTErjzlp2/ojlnd5KnOEA9TZAJygKB/UExD9f8TvGfOkoP8dhbeY0ql Il7LfpWFPM1rTWt/rEDGIq+O/RxWGb2RQ+lKV0c2dhgwxONlXGXSO7kx4ztqhc97BfJU s+CzkpzD+N0QIeAUVNt3EC3/aYXHJU29hD7aFiXiZPQoI4dCWg+kCEDzoytumbkGa/yz 7mPp8WkLSF/qFcWAmEGjUK0NuMywOpxfcAyNyHFGRG/R+b9bAczJzwI3p9ncyH5OA2RP 5PmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=RZuNY7SndnJciqLtrJZldE1+8zthThJOXaodqL6ie74=; b=MxSOXa1Dur52oMzVqQfW75dcmAzfP8534uFeMwCKOVRU2ED/Wg6pEHvACKvonsyP1H J1tTOWOmTAHwMAvgZ03smp6tGa7nCGbpj0Zjlmcsn2CqxTuhxTvner+WA6cmSyDEWHE+ Ji/l0/x3ZPa9Kh0uKykQTn7sjwWIx6njbY2b50fX4W9+c9hsvO6bw+jPZXzbm3j40cad ubjdEZKlpbrTsarr9L1nKpgeVuOg2UyKVFrV5BVmc8nx1RSBbGZVOvo7O6VmQneoMA2a jVeMaXFkoUTR6h8wygxjZuMI1DD9sgP82z6Ca0GioBlNnVkMYbP5CXEZ0eD6oFmN/49Q yLGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FG78Uq6t; 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 az12si4842266plb.5.2019.07.11.05.44.49; Thu, 11 Jul 2019 05:45:06 -0700 (PDT) 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=FG78Uq6t; 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 S1728462AbfGKMoK (ORCPT + 99 others); Thu, 11 Jul 2019 08:44:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:32832 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726016AbfGKMoK (ORCPT ); Thu, 11 Jul 2019 08:44:10 -0400 Received: from localhost.localdomain (nat-pool-mxp-t.redhat.com [149.6.153.186]) (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 DA8A92084B; Thu, 11 Jul 2019 12:44:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562849048; bh=lZFM/H31Fs5Z6ab6aWawrjKOVYQXr73MU24M7sjvFzo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FG78Uq6t54M6qxvPOcrTnLDhy+6LJohKCZpA2CPYzB2MPWd9Qd9tY1vmmCipDQ+wW iYDntFTTzMth2Ap++Ryozpuep3KcsORzj++qwyZ+DSpbxNE5D38yOoArb+RiplWHE7 ZALKy+/h4kyUrx7A2QSc/aaBvtAt16pbMdQ3qaes= Date: Thu, 11 Jul 2019 14:44:02 +0200 From: Lorenzo Bianconi To: Vitor Soares Cc: "linux-iio@vger.kernel.org" , "linux-i3c@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "broonie@kernel.org" , "gregkh@linuxfoundation.org" , "rafael@kernel.org" , "bbrezillon@knernel.org" , "Joao.Pinto@synopsys.com" Subject: Re: [PATCH v3 3/3] iio: imu: st_lsm6dsx: add i3c basic support for LSM6DSO and LSM6DSR Message-ID: <20190711124402.GC3452@localhost.localdomain> References: <73955529ae0c31f428221abb88031ab3b4165659.1562767521.git.vitor.soares@synopsys.com> <20190710194405.GA10520@lore-desk-wlan.lan> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="KDt/GgjP6HVcx58l" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.0 (2019-05-25) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --KDt/GgjP6HVcx58l Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > From: Vitor Soares > Date: Thu, Jul 11, 2019 at 11:12:34 >=20 > > Hi Lorenzo, > >=20 > > From: Lorenzo Bianconi > > Date: Wed, Jul 10, 2019 at 20:44:05 > >=20 > > > > For today the st_lsm6dsx driver support LSM6DSO and LSM6DSR sensor = only in > > > > spi and i2c mode. > > > >=20 > > > > The LSM6DSO and LSM6DSR are also i3c capable so lets give i3c suppo= rt to > > > > them. > > >=20 > > > Hi Vitor, > > >=20 > > > just few comments inline. > > >=20 > > > Regards, > > > Lorenzo > > >=20 > > > >=20 > > > > Signed-off-by: Vitor Soares > > > > Acked-by: Lorenzo Bianconi > > > > --- > > > > Changes in v3: > > > > Remove unnecessary st_lsm6dsx_i3c_data table used to hold device = name > > > > Use st_lsm6dsx_probe new form > > > >=20 > > > > Changes in v2: > > > > Add support for LSM6DSR > > > > Set pm_ops to st_lsm6dsx_pm_ops > > > >=20 > > > > drivers/iio/imu/st_lsm6dsx/Kconfig | 8 +++- > > > > drivers/iio/imu/st_lsm6dsx/Makefile | 1 + > > > > drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i3c.c | 61 +++++++++++++++++= ++++++++++++ > > > > 3 files changed, 69 insertions(+), 1 deletion(-) > > > > create mode 100644 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i3c.c > > > >=20 > > >=20 > > > [...] > > > > +static int st_lsm6dsx_i3c_probe(struct i3c_device *i3cdev) > > > > +{ > > > > + const struct i3c_device_id *id =3D i3c_device_match_id(i3cdev, > > > > + st_lsm6dsx_i3c_ids); > > >=20 > > > i3c_device_match_id can theoretically fail so is it better to check > > > return value here? (maybe I am too paranoid :)) >=20 > I was preparing the patch and if the i3c_device_match_id() fail it return= =20 > NULL so the st_lsm6dsx_probe() will fail automatically. > Checking the spi_get_device_id(), the drivers don't test the return value= =20 > too. multiple drivers deference it directly so I am fine to skip this check. Regards, Lorenzo >=20 > Do you think it is really necessary to test it before the=20 > st_lsm6dsx_probe() function? >=20 > Best regards, > Vitor Soares --KDt/GgjP6HVcx58l Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQTquNwa3Txd3rGGn7Y6cBh0uS2trAUCXScvDwAKCRA6cBh0uS2t rFqeAQCzrowWY6v6CrwXaKkUC1U9wBmyu7LaicNrBFZvExOFZQEAupmsvMoZ9yTZ gOS6GkPOJEh4byeeFrEweGB5tbWlNg8= =Ueu9 -----END PGP SIGNATURE----- --KDt/GgjP6HVcx58l--