Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp4087868imj; Tue, 12 Feb 2019 09:33:25 -0800 (PST) X-Google-Smtp-Source: AHgI3IYCGR7dv0mtsJQEDHYTJ8dzD82fXHnEU8GtAUnrgtXcDA650mApk4s0GaY1vvLkfZRZKW31 X-Received: by 2002:a63:d30a:: with SMTP id b10mr1975448pgg.279.1549992805339; Tue, 12 Feb 2019 09:33:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549992805; cv=none; d=google.com; s=arc-20160816; b=S3VCcyzC4NIDBURrSnk/Zkd+E47ZV6gj7bDsYRrzW07wOOeHO5sr4dXzTtZSmaIHgo 4/klTbjD+eMA7O/3B5l24TN5JqITLQrn3bn41bQaMl5w8IumYMbsb5tCWkh3S73k6UP6 aooBc0rUgV5pleQdTrGmm/Pq8KSIbwlXNOiAsJ7Plifd7NNav/BDsIeOEi9sRRNtwnxS 8WFRrg5CAoMf7FvtaSAZlyFtK+1Ay04l2m1c/uROxEDx3IreGDqZSvSKIw+qBf6YoeRx B8a8/3KfNlJSwH/JdOtFZ//f+ittID6hcVKc10w28mFkIZG+qFZxlhdwjuQUqqnxPEuU +/7Q== 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=MtNeFdXmEvOtvAyUUaT5c7XY51tOKex9z7q/wJEpgbc=; b=NnsRtGhQ8YGWEaNXCE3NiiMe3Cd/o2MKDzB1eMjhQV32B1/435R4QcqlvLsXF9IJAj snnns9fYEuAE0JWJzjY0oU1RrWh1YJRo5KIPRwnLJURImOBQjJG7Hc1WRDi5zGTkyoVr 3/L8mqg6KsVIn30xbwf/xR4ypOmucoKojH0bG9IH0nU8ADx1WmhUMs0rmTiOHOzVy2EL ig3AXj5mO8B7tHWoCzeOfx0gCu0suHoxjWSsUopsGKIi3wl0kUA7jC7VqZbOFV1r/E3d VC+3D+TBE46Hmgg1UYi3h/WKK+KsQv3I0Piy+D4VbuMrBDCcbUvBnUCZVu5brcqucI1o 742w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PQjhzPNg; 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 ay1si10610536plb.165.2019.02.12.09.33.00; Tue, 12 Feb 2019 09:33:25 -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=PQjhzPNg; 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 S1729557AbfBLRA4 (ORCPT + 99 others); Tue, 12 Feb 2019 12:00:56 -0500 Received: from mail-lf1-f65.google.com ([209.85.167.65]:34916 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725916AbfBLRAz (ORCPT ); Tue, 12 Feb 2019 12:00:55 -0500 Received: by mail-lf1-f65.google.com with SMTP id v7so2585629lfd.2; Tue, 12 Feb 2019 09:00:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=MtNeFdXmEvOtvAyUUaT5c7XY51tOKex9z7q/wJEpgbc=; b=PQjhzPNg/ri4Jw+2mIWA46Xt/uFszFppwoCuNqHa5L909brlPpwtrZ4xV7DdTvbSBq JquyggcJeFC6wYM31wNhH5+B/Hl8xP4rq2fdiRFSeZjOo9oKqP4G8VJXB5VAlP2Seqr5 uxQ8kkbQyE1ikybx7LnqwZJCe+580KzK8aMAPAbj+baL6aqUhTutyChCEh0x2kJlVOWO GvZwji8GQXEeSF+QTPUbp0N9AHFIRbr8XF7NxqC46dRJIu1UIHPIQQqzOrqxhZJrafws SyAAAGMCtyC52Eaeb3WUZY9lG09UKD1eDBkVtY2bOAc72JYfxDLpkn9NtdjlRcbY8t1H JN9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=MtNeFdXmEvOtvAyUUaT5c7XY51tOKex9z7q/wJEpgbc=; b=mqca8cU2JebZOLZ0C7/zzCc+eDuU6WjxKuXMbNwB3p8rAq3fw8EmS7BUER8zt7G/gk M6Evr/DBDWG7VwogiN7RLb4tzmwaAnRJZ8XTNuuq6cqZFqjzOXJZPtRtZo1T6AlnW8Td VqVQ6JmPzcHvbRO6fiGxi3qYH9/6tEm4gnDhc7uDnfi4+OEAb199NFeBCYExJEPIb87+ im/TNElcwVkolXA9NUfTyat8Q77DUrmf9OIAsWnyUVqLCbjOj9Ca2eDq+ONNMwkbEhVD C87J/+JNtVodExSDJ+f/vAUi0LWJfeaHt7PVjWih4XPG0FYJVL35xSr7X92BYItIK4Wj oVag== X-Gm-Message-State: AHQUAuaiYzGaRZtv1Y8sJ1dWcA+q5WMUrcw18Mqv0ayB9pl2mJ2VKde6 7obBkDYZSocRVyCz5SNCeiPUg0aUO44= X-Received: by 2002:ac2:561a:: with SMTP id v26mr3000519lfd.38.1549990853120; Tue, 12 Feb 2019 09:00:53 -0800 (PST) Received: from localhost (89-70-37-207.dynamic.chello.pl. [89.70.37.207]) by smtp.gmail.com with ESMTPSA id l7-v6sm2743180ljb.76.2019.02.12.09.00.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Feb 2019 09:00:52 -0800 (PST) Date: Tue, 12 Feb 2019 18:00:32 +0100 From: Tomasz Duszynski To: Mike Looijmans Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net Subject: Re: [PATCH] iio/gyro/bmg160: Use millidegrees for temperature scale Message-ID: <20190212170031.GA14756@arch> References: <1549981549-19786-1-git-send-email-mike.looijmans@topic.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1549981549-19786-1-git-send-email-mike.looijmans@topic.nl> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 12, 2019 at 03:25:49PM +0100, Mike Looijmans wrote: > Standard unit for temperature is millidegrees Celcius, whereas this driver > was reporting in degrees. Fix the scale factor in the driver. > > Signed-off-by: Mike Looijmans > --- > drivers/iio/gyro/bmg160_core.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/iio/gyro/bmg160_core.c b/drivers/iio/gyro/bmg160_core.c > index 63ca316..ad7f8cb 100644 > --- a/drivers/iio/gyro/bmg160_core.c > +++ b/drivers/iio/gyro/bmg160_core.c > @@ -585,8 +585,9 @@ static int bmg160_read_raw(struct iio_dev *indio_dev, > *val = 0; > switch (chan->type) { > case IIO_TEMP: > - *val2 = 500000; > - return IIO_VAL_INT_PLUS_MICRO; > + *val = 500; > + *val2 = 0; > + return IIO_VAL_INT; You are returning integer type to iio so there's no point in touching val2. iio will ignore it anyway. > case IIO_ANGL_VEL: > { > int i; > -- > 1.9.1 >