From patchwork Sat Sep 26 06:49:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qing Wang X-Patchwork-Id: 260146 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F0CA1C47420 for ; Sat, 26 Sep 2020 06:49:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BFDD320878 for ; Sat, 26 Sep 2020 06:49:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728869AbgIZGtj (ORCPT ); Sat, 26 Sep 2020 02:49:39 -0400 Received: from m17618.mail.qiye.163.com ([59.111.176.18]:11581 "EHLO m17618.mail.qiye.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726037AbgIZGth (ORCPT ); Sat, 26 Sep 2020 02:49:37 -0400 Received: from vivo-HP-ProDesk-680-G4-PCI-MT.vivo.xyz (unknown [58.251.74.231]) by m17618.mail.qiye.163.com (Hmail) with ESMTPA id BCF124E1403; Sat, 26 Sep 2020 14:49:32 +0800 (CST) From: Wang Qing To: Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Wang Qing Subject: [PATCH] net: Use kobj_to_dev() API Date: Sat, 26 Sep 2020 14:49:18 +0800 Message-Id: <1601102960-8322-1-git-send-email-wangqing@vivo.com> X-Mailer: git-send-email 2.7.4 X-HM-Spam-Status: e1kfGhgUHx5ZQUtXWQgYFAkeWUFZS1VLWVdZKFlBSE83V1ktWUFJV1kPCR oVCBIfWUFZS01LGUhOH01KHxpNVkpNS0pKS0lCTEhKT0lVEwETFhoSFyQUDg9ZV1kWGg8SFR0UWU FZT0tIVUpKS0hKTFVLWQY+ X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6OSo6Hww*AT8vCgEOS08rGTNR Oi8aC05VSlVKTUtKSktJQkxITk9MVTMWGhIXVQwaFRwKEhUcOw0SDRRVGBQWRVlXWRILWUFZTkNV SU5KVUxPVUlISllXWQgBWUFKQk5DNwY+ X-HM-Tid: 0a74c92c88689376kuwsbcf124e1403 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Use kobj_to_dev() instead of container_of(). Signed-off-by: Wang Qing --- drivers/net/phy/spi_ks8995.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/phy/spi_ks8995.c b/drivers/net/phy/spi_ks8995.c index 7475cef..ca49c1a --- a/drivers/net/phy/spi_ks8995.c +++ b/drivers/net/phy/spi_ks8995.c @@ -300,7 +300,7 @@ static ssize_t ks8995_registers_read(struct file *filp, struct kobject *kobj, struct device *dev; struct ks8995_switch *ks8995; - dev = container_of(kobj, struct device, kobj); + dev = kobj_to_dev(kobj); ks8995 = dev_get_drvdata(dev); return ks8995_read(ks8995, buf, off, count); @@ -312,7 +312,7 @@ static ssize_t ks8995_registers_write(struct file *filp, struct kobject *kobj, struct device *dev; struct ks8995_switch *ks8995; - dev = container_of(kobj, struct device, kobj); + dev = kobj_to_dev(kobj); ks8995 = dev_get_drvdata(dev); return ks8995_write(ks8995, buf, off, count);