linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Eric Piel <eric.piel@tremplin-utc.net>,
	Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Hans de Goede <hdegoede@redhat.com>, linux-kernel@vger.kernel.org
Subject: [PATCH 2/3] misc: lis3lv02d: Change lis3lv02d_init_device() return value for unknown sensors to -ENODEV
Date: Wed, 17 Feb 2021 11:25:00 +0100	[thread overview]
Message-ID: <20210217102501.31758-2-hdegoede@redhat.com> (raw)
In-Reply-To: <20210217102501.31758-1-hdegoede@redhat.com>

Modern HP laptops do not necessarily actually contain a lis3lv02d
sensor, yet they still define a HPQ6007 device in there ACPI tables.

This leads to the following messages being logged in dmesg:

[   17.376342] hp_accel: laptop model unknown, using default axes configuration
[   17.399766] lis3lv02d: unknown sensor type 0x0
[   17.399804] hp_accel: probe of HPQ6007:00 failed with error -22

The third message is unnecessary and does not provide any useful info,
change the return value for unknown sensors to -ENODEV. This is the
proper return value to indicate that the driver will not be handling the
device and it silences the pr_warn printing the third message.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=199715
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
Note this does not resolve the bko 199715 bug, it merely silences the
message which was used in the Summary when the bug was first filed.
That bug really is about the actual accelerometer, which uses the AMD
sensor fusion hub, not working.
---
 drivers/misc/lis3lv02d/lis3lv02d.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/lis3lv02d/lis3lv02d.c b/drivers/misc/lis3lv02d/lis3lv02d.c
index 9d14bf444481..22dacfaad02f 100644
--- a/drivers/misc/lis3lv02d/lis3lv02d.c
+++ b/drivers/misc/lis3lv02d/lis3lv02d.c
@@ -1173,7 +1173,7 @@ int lis3lv02d_init_device(struct lis3lv02d *lis3)
 		break;
 	default:
 		pr_err("unknown sensor type 0x%X\n", lis3->whoami);
-		return -EINVAL;
+		return -ENODEV;
 	}
 
 	lis3->reg_cache = kzalloc(max(sizeof(lis3_wai8_regs),
-- 
2.30.1


  reply	other threads:[~2021-02-17 10:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-17 10:24 [PATCH 1/3] misc: lis3lv02d: Fix false-positive WARN on various HP models Hans de Goede
2021-02-17 10:25 ` Hans de Goede [this message]
2021-02-17 10:25 ` [PATCH 3/3] misc: lis3lv02d: Do not log an error when kmalloc fails Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210217102501.31758-2-hdegoede@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=arnd@arndb.de \
    --cc=eric.piel@tremplin-utc.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).