From patchwork Wed May 11 02:16:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: CGEL X-Patchwork-Id: 12845696 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D13F0C433F5 for ; Wed, 11 May 2022 02:16:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232969AbiEKCQp (ORCPT ); Tue, 10 May 2022 22:16:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229891AbiEKCQo (ORCPT ); Tue, 10 May 2022 22:16:44 -0400 Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBAE481644; Tue, 10 May 2022 19:16:42 -0700 (PDT) Received: by mail-pg1-x52d.google.com with SMTP id v10so525638pgl.11; Tue, 10 May 2022 19:16:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=buRI718RFPrTtdiRLJoEyVax+0RYy5X13JOpEpadUuU=; b=O38Tu6+beNDnnVNtxh7fOgBixYQaJXblJOrMVxDv629pCOwVzoPH1O4x3it3LR9GWm WmSwqKjedt/f3uWUmwbXgxDqBSAIELGRm2sEUwe7zPkn4uf9k9o0tjRlGY+58AlIX6f+ 3ivEDQw1au4QnXgkrtPV5V6tcCB889NVaX4KMa3/OvLO/e4P1RmYFS4c1cySw6G2UaaJ pNIW64MLUCJlsBgvHGUQWppfXYV34agKMin093B8ASOXxiXK3SArgPcUhCo7v7WYjCM0 rIOBwuwZccdegIbYgwgn1cocMgNXJkytVusVODABrIKITsRpgDWE9bUwm9seX6/2SraB oWRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=buRI718RFPrTtdiRLJoEyVax+0RYy5X13JOpEpadUuU=; b=VYiwUQgLjrm62sRwqRJz0EIW3FGOvvN92JJvTdeJQ91c48mskCSy7k5lz0krQ/fWhK okj2SWzfm46tRe/U+J09zyoVK97vULTJcbwFqEH86iK3Tbl7cVidCPCot3YZlg/mWkQa ZVlEdn+9WpiCSM8TVRDCEAceGgOp2nuEc7hvc69MQF3nxmmBLnpUm8QbacWFK2JvJYan z4wYrez3KVYozjL1UTa8BLx7bU61k9y332+65c25SwDLu3ylOuuB8Jt6mLrZmDDyAcJr DG8qr36FpodCGin9ym7b0NK85x3jBqDGRgdERijfK7d7CYrPRqOZargMqCqCia9TQsBT bZaw== X-Gm-Message-State: AOAM532Wa3qVJByOYnjChE+vQcjbH+VCSuju1ORmwfe7Y/oUKXnhbQjn WOotTTh2pBpfguGG0bGwp7BoAcLCxo4= X-Google-Smtp-Source: ABdhPJwSTNC7XV5g8rgzvLhMnHke+15+xCA+f/9KoLJUeFW2q/tcqIfUyrGoJdlVs17dXjSkPjgyjA== X-Received: by 2002:a63:d241:0:b0:3db:11bc:8d6e with SMTP id t1-20020a63d241000000b003db11bc8d6emr2313497pgi.229.1652235402492; Tue, 10 May 2022 19:16:42 -0700 (PDT) Received: from localhost.localdomain ([193.203.214.57]) by smtp.gmail.com with ESMTPSA id j12-20020a17090a2a8c00b001d792761e2esm2566405pjd.47.2022.05.10.19.16.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 May 2022 19:16:42 -0700 (PDT) From: cgel.zte@gmail.com X-Google-Original-From: chi.minghao@zte.com.cn To: andy.shevchenko@gmail.com Cc: cgel.zte@gmail.com, chi.minghao@zte.com.cn, coproscefalo@gmail.com, hdegoede@redhat.com, linux-kernel@vger.kernel.org, markgross@kernel.org, platform-driver-x86@vger.kernel.org, zealci@zte.com.cn Subject: [PATCH V2] toshiba_acpi: use kobj_to_dev() Date: Wed, 11 May 2022 02:16:38 +0000 Message-Id: <20220511021638.1488650-1-chi.minghao@zte.com.cn> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org From: Minghao Chi Use kobj_to_dev() instead of open-coding it. Signed-off-by: Minghao Chi Reviewed-by: Andy Shevchenko --- v1->v2: remove Reported-by: Zeal Robot drivers/platform/x86/toshiba_acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c index f113dec98e21..0fc9e8b8827b 100644 --- a/drivers/platform/x86/toshiba_acpi.c +++ b/drivers/platform/x86/toshiba_acpi.c @@ -2353,7 +2353,7 @@ static struct attribute *toshiba_attributes[] = { static umode_t toshiba_sysfs_is_visible(struct kobject *kobj, struct attribute *attr, int idx) { - struct device *dev = container_of(kobj, struct device, kobj); + struct device *dev = kobj_to_dev(kobj); struct toshiba_acpi_dev *drv = dev_get_drvdata(dev); bool exists = true;