Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4692196pxb; Tue, 28 Sep 2021 01:41:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvfRu5HK95aa3I9iOrkdN3jYF90sBKA3RZh6UqlQEsDNqkAwjLt9KoSsYMNa+9PqpCg45o X-Received: by 2002:a17:902:a50f:b029:11a:b033:e158 with SMTP id s15-20020a170902a50fb029011ab033e158mr4026467plq.26.1632818495444; Tue, 28 Sep 2021 01:41:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632818495; cv=none; d=google.com; s=arc-20160816; b=tgekqPewli/zWQNsZpbjmspOV7afb+/r2dLHcBi5AfSvl9bKtfcb2admNeMBLzj3sr DSJWNAJnV1dHPQfQ7kQO9clTiWcu9ZUZVpyAAa2V+d7uGSTikfXYrnzihOBnJSz9u82I rhzJLgxBMsVYBIZIF4FPyTbTwhgZivWddr92MbB6FO2u1dLEqo3zILZqmDFRY3/408bz V/TNCvIcfFOp2zZI9u/x/envLcdhoqQB19jolHTS+XhvDuCMVlkn58lGhnAfliMcMnlr 5V7ylJfFq6U1DZS0Q2SIuQuE/J4FyiPS/CxZX5Wd6BbJU45Zb8ucMuIrQ7RRzhNQhvCU vReQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=x73TaEwSMGsf6IJOBqJhMbAKQfUjkLTOhEKFUx2syuQ=; b=lsD7lXYLwrtxLcWRb/n3qXlndXuWOZtRLDmALntelLc6D4P49732FZ5MvgIgZl2baC 19ym0UP/As4gTvJY+zsTvFTOXwnZTKTxMzTxzkq3RYnXcKg9+F9+bBGdgcuNfct/XuPn anum5vk1KRoPNa4R8RJqiutH+GGiPzuVBJhHAUWJcexsOd4D6DInYQyYSowip2f71pi8 lqs/wlU2F9/9N/woVYGcLT/+IbFZC5iwGoV9QA2rzrTlNsBgmNqa81YioxJ7WV70jjvE m9+fLwNXCEww6EA+roctFRsin9I6QR+bufrapiX1fmcDI3EgVzBm380YKi+Pr+98LglX rnBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FUn7TzMw; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e127si26284060pgc.324.2021.09.28.01.41.22; Tue, 28 Sep 2021 01:41:35 -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=@redhat.com header.s=mimecast20190719 header.b=FUn7TzMw; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239679AbhI1IlA (ORCPT + 99 others); Tue, 28 Sep 2021 04:41:00 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:36811 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239637AbhI1Ik5 (ORCPT ); Tue, 28 Sep 2021 04:40:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632818357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=x73TaEwSMGsf6IJOBqJhMbAKQfUjkLTOhEKFUx2syuQ=; b=FUn7TzMwAhG0tzci8BySJV/YMdTWjhDNIjMRI6g8pkVMFxqXnJaD/72rQqtXNRo3EFBN03 NQcGuwZR4tfkUzVvA3sce924GFUvnMGscvFDy585SVEXp6mu4SC8OKHiYysD6ndsyPLq3n Y9FHnDKnLdv2Z2sJi0N8D/7RQ9tSVbo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-459-hkCjyarUMkiVPhb0GwvSSQ-1; Tue, 28 Sep 2021 04:39:15 -0400 X-MC-Unique: hkCjyarUMkiVPhb0GwvSSQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 28E9D802947; Tue, 28 Sep 2021 08:39:14 +0000 (UTC) Received: from xps-13.redhat.com (unknown [10.39.195.86]) by smtp.corp.redhat.com (Postfix) with ESMTP id B27815D9D5; Tue, 28 Sep 2021 08:39:12 +0000 (UTC) From: Benjamin Tissoires To: Jiri Kosina , =?UTF-8?q?Michal=20Mal=C3=BD?= Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Benjamin Tissoires Subject: [PATCH 2/2] HID: lg4ff: do not return a value for deinit Date: Tue, 28 Sep 2021 10:39:06 +0200 Message-Id: <20210928083906.43983-3-benjamin.tissoires@redhat.com> In-Reply-To: <20210928083906.43983-1-benjamin.tissoires@redhat.com> References: <20210928083906.43983-1-benjamin.tissoires@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When removing a device, we can not do much if there is an error while removing it. Use the common pattern of returning void there so we are not tempted to check on the return value. And honestly, we were not looking at it, so why bother? Signed-off-by: Benjamin Tissoires --- drivers/hid/hid-lg4ff.c | 5 ++--- drivers/hid/hid-lg4ff.h | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/hid/hid-lg4ff.c b/drivers/hid/hid-lg4ff.c index 5e6a0cef2a06..ad75c86e0bf5 100644 --- a/drivers/hid/hid-lg4ff.c +++ b/drivers/hid/hid-lg4ff.c @@ -1445,7 +1445,7 @@ int lg4ff_init(struct hid_device *hid) return error; } -int lg4ff_deinit(struct hid_device *hid) +void lg4ff_deinit(struct hid_device *hid) { struct lg4ff_device_entry *entry; struct lg_drv_data *drv_data; @@ -1453,7 +1453,7 @@ int lg4ff_deinit(struct hid_device *hid) drv_data = hid_get_drvdata(hid); if (!drv_data) { hid_err(hid, "Error while deinitializing device, no private driver data.\n"); - return -1; + return; } entry = drv_data->device_props; if (!entry) @@ -1489,5 +1489,4 @@ int lg4ff_deinit(struct hid_device *hid) kfree(entry); out: dbg_hid("Device successfully unregistered\n"); - return 0; } diff --git a/drivers/hid/hid-lg4ff.h b/drivers/hid/hid-lg4ff.h index 25bc88cd877e..4440e4ea2267 100644 --- a/drivers/hid/hid-lg4ff.h +++ b/drivers/hid/hid-lg4ff.h @@ -10,14 +10,14 @@ int lg4ff_adjust_input_event(struct hid_device *hid, struct hid_field *field, int lg4ff_raw_event(struct hid_device *hdev, struct hid_report *report, u8 *rd, int size, struct lg_drv_data *drv_data); int lg4ff_init(struct hid_device *hdev); -int lg4ff_deinit(struct hid_device *hdev); +void lg4ff_deinit(struct hid_device *hdev); #else static inline int lg4ff_adjust_input_event(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, s32 value, struct lg_drv_data *drv_data) { return 0; } static inline int lg4ff_raw_event(struct hid_device *hdev, struct hid_report *report, u8 *rd, int size, struct lg_drv_data *drv_data) { return 0; } static inline int lg4ff_init(struct hid_device *hdev) { return 0; } -static inline int lg4ff_deinit(struct hid_device *hdev) { return 0; } +static inline void lg4ff_deinit(struct hid_device *hdev) { return; } #endif #endif -- 2.26.3