Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2706105pxv; Sun, 11 Jul 2021 23:19:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnkmR5sH9b2RGg6UJlNJMH4YKMJiCifpYwf9Vz52YEEtQ/Y2Ti1x5ODuH8GfaVf4kVFs6T X-Received: by 2002:a02:a310:: with SMTP id q16mr43839292jai.8.1626070746906; Sun, 11 Jul 2021 23:19:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626070746; cv=none; d=google.com; s=arc-20160816; b=tq0BzV3JEjNNPsg0rInztyu9bEYlHs9lD0/6ObhXuktXe0/NsCWjfLpCbstZzy5w5F ohNxrl79UeUAmdaKh5iGf5kDgfTvNdpUjaGSS/1T0nRITFl9Qbm6ZuA0mrdCvseAMsMA r4JLFOACfGrml+01qg888WfgtCih6seD93xFxwenUl30fTf5GY+fPBSuJ2e0oAyEA21a 9MDhjPGMO7ZniVVUxMbZZSiGPrkb1RxWUOB1yCUmnML+MPHd2lFuhimmBysQzX5hN6jW c3VDGDtWkQGizJv0p93WmabPBx3NFiiGN8hcKBTUar2v7CrwfWFB42/ZZ/pbLJPEHbyV +awg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=yYkueDi8dbsKyFuHKOws11zHAM9w4TYPRqLtCEFvXFQ=; b=XFy5QhVVmhwOXULVtjPzxt6FQccWBVgKj6ujwqs9RHg0QkSpNnR0UwLQVLtIaAmWOr CW9H72L5QjEkHWDSRbWd21ZwIEUGxhRyeuBhgsdvFxxJlYr/1DRrOVx4krq2ZYDQk0YV linaklU5s75a5I8856/btMgmKBhxuET0ZWiWz1yEE9/tcI5t+QHINrleqOrZNjrvaAcw urc0o9G7jaU/G97Fv+LCtN9meyl3vSm7lykS2ir0yOdUK+beHglkk1tsGgWWHVZZI9xo /FCmUw5X6q+vFy+fAa4OxtRuxE6fMyfdiUK7/nN5twB9oJyNMzXEHKlIKg7zbw9X+NmB Y8sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KQxyIlOJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r193si5650046ior.11.2021.07.11.23.18.55; Sun, 11 Jul 2021 23:19:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KQxyIlOJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233214AbhGLGUw (ORCPT + 99 others); Mon, 12 Jul 2021 02:20:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:37590 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233772AbhGLGS5 (ORCPT ); Mon, 12 Jul 2021 02:18:57 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2528D610F7; Mon, 12 Jul 2021 06:16:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626070569; bh=tk1QEcPODV2C91qo+LqjKsCq4YaNsnCK7AOaeltf+b4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KQxyIlOJG9bvt/IlmQjc+XUaCOIehaH+/Tb+FEv/j2qaLA3z0zygcnQvS2UVj8B4Y FNwFLyzi0ami2WQ58mKa0o3JkdnlQ9G/b61fRCGKhB4KZp95++yPLu2ed4Ay9bSVbM R6bdFay8FXd7wTmrT4lHmtaW6hmVBgxqN3ixOAXQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Oliver Lang , Andy Shevchenko , Marc Kleine-Budde , Stable@vger.kernel.org, Jonathan Cameron , Nikita Travkin Subject: [PATCH 5.4 046/348] iio: ltr501: ltr501_read_ps(): add missing endianness conversion Date: Mon, 12 Jul 2021 08:07:10 +0200 Message-Id: <20210712060707.367927618@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210712060659.886176320@linuxfoundation.org> References: <20210712060659.886176320@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Oliver Lang commit 71b33f6f93ef9462c84560e2236ed22209d26a58 upstream. The PS ADC Channel data is spread over 2 registers in little-endian form. This patch adds the missing endianness conversion. Fixes: 2690be905123 ("iio: Add Lite-On ltr501 ambient light / proximity sensor driver") Signed-off-by: Oliver Lang Reviewed-by: Andy Shevchenko Signed-off-by: Marc Kleine-Budde Tested-by: Nikita Travkin # ltr559 Link: https://lore.kernel.org/r/20210610134619.2101372-4-mkl@pengutronix.de Cc: Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/iio/light/ltr501.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) --- a/drivers/iio/light/ltr501.c +++ b/drivers/iio/light/ltr501.c @@ -408,18 +408,19 @@ static int ltr501_read_als(struct ltr501 static int ltr501_read_ps(struct ltr501_data *data) { - int ret, status; + __le16 status; + int ret; ret = ltr501_drdy(data, LTR501_STATUS_PS_RDY); if (ret < 0) return ret; ret = regmap_bulk_read(data->regmap, LTR501_PS_DATA, - &status, 2); + &status, sizeof(status)); if (ret < 0) return ret; - return status; + return le16_to_cpu(status); } static int ltr501_read_intr_prst(struct ltr501_data *data,