From patchwork Sun Jul 30 20:37:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Armin Wolf X-Patchwork-Id: 128291 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp1677824vqg; Sun, 30 Jul 2023 15:02:08 -0700 (PDT) X-Google-Smtp-Source: APBJJlH01ziDWF/7cRfN3qUPzs7sNYkukiZo8kIOnewJ7cf6JVckxJ2ZkZ9ZDSD23X106dfuvqj8 X-Received: by 2002:a17:903:244e:b0:1b8:aee8:a21c with SMTP id l14-20020a170903244e00b001b8aee8a21cmr9839745pls.31.1690754528506; Sun, 30 Jul 2023 15:02:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690754528; cv=none; d=google.com; s=arc-20160816; b=kM91ZJz3f0Zg2LGsGlywBYr0f963nltGGqyBlpxhowqH82YyMolxW3g2vkZvpWN0R0 Dngi3GtjtqoL89vSdynU0rFMLpoFe8bUDOznJv7ekI++ZOYrMbhklfsdnUvHniS6hZE/ eKaSPO/g+JTSFmaqn7DPIZmcRJREYfPTiXvZ7TKg8qgPUNjf1N9rT5PVUMs3ubM4yjUE mPU7ro0IkJRSGIX8JvIXRJumvCVczlT4tJUR/esdT9hhLNzTArdQMf5B0oy0+VY0ytFw mbcb/p7bIQwoEBFP0SFnTEy2+VPJTIiD69B/9tApadcvYYczs6qw/7aHh96rXWK85EMt eVBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:ui-outboundreport:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=kUPEgxDR7Ko+CyWt/vsRUp4/8uqTKCM36Uho9Goambs=; fh=e8SeHVBV39LDceUoMP3i4hF2US4qLv4cVQmQlOAT1Y4=; b=CfNMzxjM3c3hhPGBjrsovUS++mzRCHzCwLk9O2+H2LwVEqKP+7H3KzuPRXaOse15F1 LNTA5xCrUX0cyor9w0LH85TZhZWYmrN8Vn3Fl/gG3jXOPetYendjxXqpRjfkCUJTgI8p EW7puDZx6e/OBB5bLcVV/gtMCgHXDB1hpgCvp+gUpblHVEtUFXAL5azMXdFgpaovMms5 lk9pZsLZSbxoOIfDdjEIJpSrw3WTAIz9yYDkTVImPVCzJkI1D0hCcST3/x4DJlSlgjzh 1hZKXBGgYgOmJ44M+uI6RUIvwdmOFCHSQQpMoOeaerJ7nno2ias/zFaKaHYxLRXd8t8O zwXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=kowpZfu3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmx.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k18-20020a170902c41200b001b89cda5e12si6499811plk.546.2023.07.30.15.01.56; Sun, 30 Jul 2023 15:02:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=kowpZfu3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmx.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229873AbjG3Uhl (ORCPT + 99 others); Sun, 30 Jul 2023 16:37:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229602AbjG3Uhk (ORCPT ); Sun, 30 Jul 2023 16:37:40 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EE6BE7B; Sun, 30 Jul 2023 13:37:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1690749449; x=1691354249; i=w_armin@gmx.de; bh=q7OP8V2DT813Vh5AtHafrOKSFe4UpPHy9Xm2bDdU1kY=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=kowpZfu343ZK+RMc8H2L7q/Mzd4NQ0gMBL5b2wfvDfytLI6aaRHBp3ZOKEFXXzYo5Hw+vfw 6xRFIYba3RqFINQqZ1Wc3qk1mmTYNf49cd/EzSK/uWvnLmA8hkVMuvKQjLWYQVAIs6AFGZa8j Kcd/+G2DG6CMimmxKXCnaxepofkWHN7JqnV0FrBqP2xIggv6YHDtpZkBbK6R/8+CoLHypMa9k gYekBIXbjlDdw2HsAQRzhNFxLF93bbQLy84zWzv/JdcbMt1I5e9kjNgf31KqyXZPCXyMdubTg 9kqKIAoWeIxcIpfUfJlIcbe6HBaIA2J7qwfW2hgUogfkURb2V6nA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from mx-amd-b650.users.agdsn.de ([141.30.226.129]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mg6Zq-1pvpxu3Lgs-00hcts; Sun, 30 Jul 2023 22:37:28 +0200 From: Armin Wolf To: hdegoede@redhat.com, markgross@kernel.org, thomas@t-8ch.de Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/3] platform/x86: wmi-bmof: Use device_create_bin_file() Date: Sun, 30 Jul 2023 22:37:21 +0200 Message-Id: <20230730203723.8882-1-W_Armin@gmx.de> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Provags-ID: V03:K1:CdbeZQsXtKr9gi1eNdbTGVnk8pvpGaJz1jXBA1gTTkaiEr8xSPK 8E05q9XA7a2Pq8W7CvwcN9x1uJMbjLYIzea8aCDgfsGnRdoAo4jDMEzzlGsIgacQZjcCO/U 8pQvelw/F7DBpbfEeBPuClURw2XZrTQFxP9rOz4JQt+ucL+NO0+/LYls1q7aBQattOtEXt+ pY7oAfh2B8RLTawWdqUEw== UI-OutboundReport: notjunk:1;M01:P0:WWo3pNYYI5o=;sbV8szpItLDdEUNWWVcud2Sls2y VYmyEzUdqwOONARNTHJ5nke28qFWModApFJ4PFUwv3Vfh5edVii6spFasUdn5nAKnZ8vF8oLg kBVAdXJoDGuO5clpzzuPgI4EMIJxbypgCjpFWB8TTN6N2Az5HPjqBvut0nJjNGZ5DnhmvKeiT 2Vj8yzEFrQeLCdXW2Ngt/nKFPuiplnp6zb9+GZ2kF8FiEYdmWZSngfpovqz6CA1CrB9UNZF1Q 9E2qGVhvH6tcFRRcdnOf22HAa97IWSBe60BaVwojguXHh0RXMycXxvhaboh3uANPfiP65JN+G U94hGQT6DAw2mQMUqahA+/RIN41vtHbpdNLvmhPO44Yo05Lsw1BGEzPQ8u08oD6DkVTMwCwYv qvumQPE6ZVqgfJYo/v5a2pOB4tnH3XBVEwaShhJcjutDQjR1ZUiPRS2ycKjhzJ2rDk3hADeH0 MioLiJc074v+q2umhe8KZM0fit3NPQR4gn8lB+2rq1OESOpJ4zaASucHyr8g+l1fhm1FPFV/B FeQq3J4OkThcMLf88o84+5k/rccaB7uOxqs1o59WnlpGHH22m/PqEn8Bc4jYcuinhBCFenJXq KLXiBUZQHtY6LkGq+dbTkidQ2dOdON0h/CdsaHrulfI8wSM5tlvc1QwUm3eI69M/io5YvQNiI jPJmB4NQ4L1WZaI43slwvxKz1iX/p+4vfRqJX9590WiG9B2ghFXn2T9bI7/aTYzDZNhNLjyqi EsZxzc8GtZeUE6X7bCOyVIID+heWxZA/banfaLg4uJgNJwiDwT877H/goTi52oJGib53lNVdT Fiu4a7t1hRY8Ynx2W7ZAumUSYC1KBkK2F6+yCMQ8tR6AMRaoARVy4Zz/fe14/VbN6Qc4MrELw cus0oYKjSkbgntdMNuvYW0mJusmthWzmBY+s3570uRaP67P0M/WjWkY5Z0Uw8dL+0mLYLOOqW i4gtmaobG2+7gm8YkvHYly06LQY= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772884397333742236 X-GMAIL-MSGID: 1772884620287055334 Use device_create_bin_file() instead of sysfs_create_bin_file() to avoid having to access the device kobject. Tested on a ASUS PRIME B650-PLUS. Reviewed-by: Thomas Weißschuh Tested-by: Thomas Weißschuh Signed-off-by: Armin Wolf --- Changes since v1: - add Revieved-by and Tested-by tags --- drivers/platform/x86/wmi-bmof.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.39.2 diff --git a/drivers/platform/x86/wmi-bmof.c b/drivers/platform/x86/wmi-bmof.c index 80137afb9753..d0516cacfcb5 100644 --- a/drivers/platform/x86/wmi-bmof.c +++ b/drivers/platform/x86/wmi-bmof.c @@ -75,7 +75,7 @@ static int wmi_bmof_probe(struct wmi_device *wdev, const void *context) priv->bmof_bin_attr.read = read_bmof; priv->bmof_bin_attr.size = priv->bmofdata->buffer.length; - ret = sysfs_create_bin_file(&wdev->dev.kobj, &priv->bmof_bin_attr); + ret = device_create_bin_file(&wdev->dev, &priv->bmof_bin_attr); if (ret) goto err_free; @@ -90,7 +90,7 @@ static void wmi_bmof_remove(struct wmi_device *wdev) { struct bmof_priv *priv = dev_get_drvdata(&wdev->dev); - sysfs_remove_bin_file(&wdev->dev.kobj, &priv->bmof_bin_attr); + device_remove_bin_file(&wdev->dev, &priv->bmof_bin_attr); kfree(priv->bmofdata); } From patchwork Sun Jul 30 20:37:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Armin Wolf X-Patchwork-Id: 128284 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp1662413vqg; Sun, 30 Jul 2023 14:04:46 -0700 (PDT) X-Google-Smtp-Source: APBJJlGBxg6tpQt0a/Gr9ujC3eUo/elKQX1+bF01/kuUpBWkvdkmNIIzWvNxuK6foR80jZSO4U9U X-Received: by 2002:a17:906:59:b0:99b:d435:e994 with SMTP id 25-20020a170906005900b0099bd435e994mr5745953ejg.32.1690751085953; Sun, 30 Jul 2023 14:04:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690751085; cv=none; d=google.com; s=arc-20160816; b=XWqq2yjpBChpEkj3lXFPLLucq0UrsdE9Y6OdmgE5zqzaEffDU/UsRtHyPCgFazOQ7z xhhyKUL6bEidSwaAPia1f0E760/j9hugDGAkHLSXItiVSw8D+pOTC8kGWNu7jLSWd0HY q1k5Pfw4ne93zBtzFNFUhce6rDqMB8s3QQv0u17gbiK4OXRflcM1onhGvqyZ7AGcR10G umoZedODzJIb2wWpmDnBRmwxGuU4msaXnO5bmFHmlSx+YeWkaW1XsYuSpZr/BGwHRDjE Jt6XqJcH8kRwPsKF1rZydVVk8JvlQ+LJyOzIFSG88BeM5u/Uw5Bqa3ixL9el5DI8l+Sx l64A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:ui-outboundreport:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DjF4k3Loqnbwvc+n35jjHInTccG0HA1aG32PwydUs6U=; fh=e8SeHVBV39LDceUoMP3i4hF2US4qLv4cVQmQlOAT1Y4=; b=Mm+2TSPLNIOZPQromtPRUtRxmb1cKuhNhK9WyNZYeI2h3JZkEjMy6YGTpqvrJkkZAt Sp7BTR3jSIMTBEMg5MVwk0TlnbDaHXTY+dtFqZrKNdy7/u+iWXAY3gJo9+cb03wSjitz ZlEGoMHznLn/oCIDiF2y2MYPBKuhcUYFml7zsitttBtSxkjbR6Q3rT2HXknOwHXDtz2s cqg8NyhjXCb9hZB0VjVtHtQR1zQ4DxRB8TdyjKicOYJuSUCqAg39h+/HKBtzFH+gCbX7 5TFAD6h10ql+k8qe0v0lOgAzfOtjRIJIsIkmIU2/X5fWfpiy04mriob9+lvJyvRDyyMP jKpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=qChqEIyp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmx.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ha11-20020a170906a88b00b0098e38b3b7e3si6028309ejb.793.2023.07.30.14.04.22; Sun, 30 Jul 2023 14:04:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=qChqEIyp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmx.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229749AbjG3Uho (ORCPT + 99 others); Sun, 30 Jul 2023 16:37:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229899AbjG3Uhl (ORCPT ); Sun, 30 Jul 2023 16:37:41 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6940E78; Sun, 30 Jul 2023 13:37:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1690749450; x=1691354250; i=w_armin@gmx.de; bh=OHiBItOOoRVvdzRbZEFrTfef1epBD6WyUoDTx7C3Ghk=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=qChqEIyp5BPwswbnVVqJZUGwXcTJ8qjTlBl/bmSZfvh26bQpZO6c4y63MDgLmGSJplMxd+U xFJIHXoZp6aXlR5QXk2unyPIyncDsYgIi7NVp+SJW4IP1KKQenL1uj/nKtQOODiJXyYeojy7U MW9D/MSNLs2WogU1ADAdJWv5gohRxuwRaXQcJdCDLJxg3nXYGFm2vIS9ua7QWV1kuU3oYmz/d WumCO+qpJ3E4rtUPHxbcwxMlr/HVr4AsNd9OuKjeRdNKHawcV4yPttbrdO3NQPmGq/lXzV2Do 3orwm0ZJYrk3ca9mu9LuRUKZ7kICwB7IK1n7FX/xYTwQDJc4jLkg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from mx-amd-b650.users.agdsn.de ([141.30.226.129]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1McYCl-1psFSZ1JDZ-00cxed; Sun, 30 Jul 2023 22:37:30 +0200 From: Armin Wolf To: hdegoede@redhat.com, markgross@kernel.org, thomas@t-8ch.de Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/3] platform/x86: wmi-bmof: Simplify read_bmof() Date: Sun, 30 Jul 2023 22:37:22 +0200 Message-Id: <20230730203723.8882-2-W_Armin@gmx.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230730203723.8882-1-W_Armin@gmx.de> References: <20230730203723.8882-1-W_Armin@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:+jEY729e0a0EDFLX/WhlWcj1P0nEjB3vk7ox0uUuhU111ghutn1 106dAHOv+az6LaTIWKTAgjb/Ib31fmCvb0YJz0UxLI+d/sZq3fIEaKQ9TKUtFf3vSIlxwB/ iGwKrlV+zLXdgrgqqmtX4WF0+PmFJyXlyuA/x7NTx3e6lfwWXzdVquPEYRmY1ZdseQDJiyN ikVJ4oYQ6Vpd7trEuZDgQ== UI-OutboundReport: notjunk:1;M01:P0:JuG2dx9mxfY=;KHB0ZeQJ2kTc7/U0mYkH1F6AFA5 Edm45XN0TAdkrmHEA3asaX0TCBvTc3tG4Z5FTxaQZqJ86u310FuE+05tRdZHReYi7QvKqt3Fd tjbGfIMPLdraKBnPXKch97A7CkhxBTAsB9K113sjAYnJlRcBa1If4I6Luvn3chrrtIw/imuPT 4Fou2IpziAcwPVWz6jNsopqfAN6Otje4wjzqIU/d0nrpg75m7hDXQHhhphdVkznnl3hgy5SPC k+JEmU5eEqYk9e5En1svTVmzmGarB9Ws0lc5OV5yDfSXwZWXLQKfTXsknQqFjDup7MDTx6c7O bqTBbCDF9au7DCl1NaDX4KH2IMs9sGLXgsOPcVFcshxdY0k9HOqXfUa6lEB04zuskc6YcsIWY MLj1OvPQTaui9MOaOonhhZL7AmM39ja5yrNhkmg46RP8GkHu/w3f25Y7Rsj6XlCOe5uBGtUXy leXnlraynTiqHnJoZi8hbZUMYG02oI09KDX81gzvcbcG2JSwNOwWj8KegfPXMpXCYj0/S8rCp 8pI6kcg96/uF81NSqzeC97o+zModmFcJ4aWFAk8wpHDabwqI6uC9LleMWJ2Tq5ztLwLSbWVRk hdJYeJU+BLDC/LtVpUdFEbWkpsKbsKrRTwmffZpZsJa6YgmKGULraePJX6MJN7cAPuutmEg/v RuKlCqNJatEq28eyI6B9kv2r9Rd7lE2u0omfP1oGf6SBkrkGTaF2wPZzmuqTu+7pFpDLnDZ8Y gg8VVzuBhERPCFQ+jezo1gTQVfVO46gsTl6ypU0bVf3u0EEI6la3SvtVfaGMc2CQRtxRun71b 0xLXWYz2ByFwcu1qJ3LgabfX2HWbbOTo4KgLkrmpFq+SpdwFbj+ZeC796L52ug4/WzlN281Xz T+VmlskKYXV3TPc3h8UoAbQ6pnqMyLlHZWu0GUObne3NnUJy6LS5v4U890DKb4jburajB/esF cNfy7dL+twhohXECCJrUztSuDX8= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772881010417103992 X-GMAIL-MSGID: 1772881010417103992 Replace offset handling code with a single call to memory_read_from_buffer() to simplify read_bmof(). Tested on a ASUS PRIME B650-PLUS. Reviewed-by: Thomas Weißschuh Tested-by: Thomas Weißschuh Signed-off-by: Armin Wolf --- Changes since v1: - add Reviewed-by and Tested-by tags --- drivers/platform/x86/wmi-bmof.c | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) -- 2.39.2 diff --git a/drivers/platform/x86/wmi-bmof.c b/drivers/platform/x86/wmi-bmof.c index d0516cacfcb5..644d2fd889c0 100644 --- a/drivers/platform/x86/wmi-bmof.c +++ b/drivers/platform/x86/wmi-bmof.c @@ -25,25 +25,13 @@ struct bmof_priv { struct bin_attribute bmof_bin_attr; }; -static ssize_t -read_bmof(struct file *filp, struct kobject *kobj, - struct bin_attribute *attr, - char *buf, loff_t off, size_t count) +static ssize_t read_bmof(struct file *filp, struct kobject *kobj, struct bin_attribute *attr, + char *buf, loff_t off, size_t count) { - struct bmof_priv *priv = - container_of(attr, struct bmof_priv, bmof_bin_attr); + struct bmof_priv *priv = container_of(attr, struct bmof_priv, bmof_bin_attr); - if (off < 0) - return -EINVAL; - - if (off >= priv->bmofdata->buffer.length) - return 0; - - if (count > priv->bmofdata->buffer.length - off) - count = priv->bmofdata->buffer.length - off; - - memcpy(buf, priv->bmofdata->buffer.pointer + off, count); - return count; + return memory_read_from_buffer(buf, count, &off, priv->bmofdata->buffer.pointer, + priv->bmofdata->buffer.length); } static int wmi_bmof_probe(struct wmi_device *wdev, const void *context) From patchwork Sun Jul 30 20:37:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Armin Wolf X-Patchwork-Id: 128289 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp1675528vqg; Sun, 30 Jul 2023 14:54:21 -0700 (PDT) X-Google-Smtp-Source: APBJJlHhHT6Nqu6yOihNMKyt1waDAjDm+KgS0Ap44WOb8AIvyY7Av6hSE4vBgvHe/e3LJRsmUr9d X-Received: by 2002:a17:907:2c77:b0:98e:1c4b:10bb with SMTP id ib23-20020a1709072c7700b0098e1c4b10bbmr5405067ejc.35.1690754061213; Sun, 30 Jul 2023 14:54:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690754061; cv=none; d=google.com; s=arc-20160816; b=UjzxzQYDhm3Z7zyyWJIO6zZQIMxNGIj9ngCj0o/PmSO7+hsEbzAmiLQSuuK8iz359Q cTxmhd0uK1klwQDpntNzZB5wjqS62CrS+UOc341dPGR+W0LCh7hHnkGPwUwwtcDOYqGD CAe5gRP/8D8nU7tCH9nZ/5Q1kr1ItRbgm7CjkNOM/EdsAFaC7Y39KsYQfTEcTtk2C0MA kq/H0pNceMkeeOzyHqM19lqpMhHLVyIHxatxHzOuOFx3deOlOUf6m1c2l9Sxs7nUclr7 o9UxyGRbt5F4ZA0KFvQ0h/xwuhLxcZHR/2V0UCOHyYJVA3Zjxn5CD9VBF9OI1Bp8fuw3 kcCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:ui-outboundreport:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3zW9reUri2GmgKVA9k+GvFA6DTc4glm+lRejUzrz0bk=; fh=e8SeHVBV39LDceUoMP3i4hF2US4qLv4cVQmQlOAT1Y4=; b=tqumFCaU2YJoPlu8TWik0svp9e5iu+FN1e9B7v3WwbWrIDmOOP60pHer9sX0COt1QZ yrk1GAtCtSQPrBzrr7rWYc2oL+Cy+OOqiqaoV+Gar8TXJhMPhcTZ/Jf7gDAKKjy8EpeP c1/GfsSqKlP/BDiXG84w5wsSKYYgr9mxujMMdWEGMBlrcNbWISytCK14YxyuwKZTk053 6lPtdp1dnOjvpbz0CudywztLEEasJaRKS9Jezoi77DLb6FcKfUsCz/ieN+0v5ddApSbP BFZC3b5HKgdNbgSqsA70yKYG7Voimi0lEm5HT8RoW/xg8nvHtfxq3hLA54U/DbNOKRMP haQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=uiT8Skeb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmx.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e24-20020a1709062c1800b00991d97d8eb5si1790339ejh.145.2023.07.30.14.53.57; Sun, 30 Jul 2023 14:54:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=uiT8Skeb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmx.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230085AbjG3Uhr (ORCPT + 99 others); Sun, 30 Jul 2023 16:37:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229570AbjG3Uhn (ORCPT ); Sun, 30 Jul 2023 16:37:43 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2210E7A; Sun, 30 Jul 2023 13:37:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1690749452; x=1691354252; i=w_armin@gmx.de; bh=0jR/6ZGUONaLBBIaqgMEGUHGN3BM7Rjb+UAgiJ+IqRE=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=uiT8SkebHzuyxE2Wj7F2q1Fv+PCk4rrYtXt5YhUaMwPzjz+nOpcJ05ixoemfzUbJZYWNDi0 y8pZQYzxjtfrxLN9+w7TymnWG3KK4r5JU8dqZDJHAHkUGJCT2IychFY6pcmPF9IOR9HP5oqU2 ow7VDT8f1LkqR+YA+k35YGS7RU/yt7oavCsbz0Jqqc9COoFwO4BA7OztzreyeczWgTJi/FQO8 5xJ78Pg8I8xYLdfG+PphFA9llE4zH6LgIc5LBTKOry4MHQmGaI6WCWxx+tYujIDrYHP1nPtRI SkbX3k4dDqakpr68WIlZJ22VuSbkPBwBWpV3grG260hGlGEn0p1Q== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from mx-amd-b650.users.agdsn.de ([141.30.226.129]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1Mqs0R-1q4P5W3rGL-00mrY4; Sun, 30 Jul 2023 22:37:32 +0200 From: Armin Wolf To: hdegoede@redhat.com, markgross@kernel.org, thomas@t-8ch.de Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/3] platform/x86: wmi-bmof: Update MAINTAINERS entry Date: Sun, 30 Jul 2023 22:37:23 +0200 Message-Id: <20230730203723.8882-3-W_Armin@gmx.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230730203723.8882-1-W_Armin@gmx.de> References: <20230730203723.8882-1-W_Armin@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:xt9CJl+6ebAwtAfFCoAdCgLIHVqRaDt6jYAh5iNQOC+yYSfoU65 /isk5k7Jk2tDpKP5LMsvRbjbczZrgXeKhQ3owfpd/dxw3r/6NhRaTTNxS4G4sp7StounmAL GKn6gCaQ/81XwP4yP05LrC3tqupMB7TU/emQ8AqSBjIt7BUK1WpTUeBsbeOYgCDIt0VPQwd Qz5JRx5UKwTf/kiDdvnuQ== UI-OutboundReport: notjunk:1;M01:P0:yuc/2LycNwA=;SvgsGQmsLa8eCAOuObrgVPZQ1Ep pynOpaFkCdrU3K+RHsdxOqKb9A+7uJZ6FWxkusyddi8+/tb5qi+1GJu2f6D+xM4zGReuNBf0q kpRJNCF8PPaCohudrPzK3Iol4wdEMVk1g4tNypVSQg2NPUrAtHyrU2lz/bOeQmrCsIZXvmt/t Kp+voMkmqzajG3xyIcTY2p09NdU9qc6wQrJxgp6MNjvTJuKZ2K6+RQ8BwMtmxs6MJj/nlp+VV gvD+irYf60kLmf/P1mLa+rfUwSWVbMdNq2e7R5yxhjzCbN83J0w/N1EzVbXm01ivNZp5Aeg91 i05ubKV0XL3SJT5VRcs1zICKyGjnuYaeD+J1V7myj7sLYdL9xqGWhe4sOEPUXkC5QM3VzjjnM km6UTTQuntKZokyqwZAtOO2t763Mg0A8Ud36CSVHkV2abJJJ4lZpLUDQ3NVEuCJNyIxVO9omR LOlsbPjv+ALXtI6ap0SJmcX00FsC8MJ7KONGHL0w5lpSL3LtBjVwNokRHTRuDm7OXat02mWnv st5YS+U36ViG9Hf8JzN3MslCm3/mKANqKyHKZhW8WaZczYgkQxs8wX53EVoOgcNTOda4uvwYn rTbcILI7xH8mcL4xJJt3pgPJj/JAJPt3IgnbzjI7qEuhb/1ETCDLXdYnMcfVJCSWKJr05nPD3 2URlvSbZobEp8e93RxrSa+Hdffa/amxdBtPf8fLSXP7/8T3eU06yPi0E0+PzH8Hge3XKfhWhs Cr5q/2qVJFSVEDxGa+w7T+phO9ZjudNT17rZsR2GpoRSmbdG8iJ7vMZgBYU6tob/cG3AjycWR sfSIHx97PUwislzRa+wUy+iwANJiqsb+A+BlVxxhq5rv0N+M2Bp5/O9zj978V0LN/OqHviHvc hdIQRf2Rx8uvfdrKoJ3ec+qARG4mrFHt7zRAxrBcTT/dHciNhwm0V8zN0BVWTJTb9yItNnpXx /1jhegRg6pCup1bpQpbAmUi9kF0= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772884130515533357 X-GMAIL-MSGID: 1772884130515533357 The WMI Binary MOF driver is important for the development of modern WMI drivers, i am willing to maintain it. Also fix the mailing list address. Signed-off-by: Armin Wolf --- Changes since v1: - Add Thomas Weißschuh as reviewer --- MAINTAINERS | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.39.2 diff --git a/MAINTAINERS b/MAINTAINERS index 426d3be71da2..10a182883993 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -22954,8 +22954,10 @@ S: Odd fixes F: drivers/net/wireless/legacy/wl3501* WMI BINARY MOF DRIVER -L: platform-drivers-x86@vger.kernel.org -S: Orphan +M: Armin Wolf +R: Thomas Weißschuh +L: platform-driver-x86@vger.kernel.org +S: Maintained F: Documentation/ABI/stable/sysfs-platform-wmi-bmof F: Documentation/wmi/devices/wmi-bmof.rst F: drivers/platform/x86/wmi-bmof.c