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:CdbeZQsXtKr9gi1eNdbTGVnk8pvpGaJz1jXB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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); }