Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3729496pxk; Tue, 29 Sep 2020 05:00:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUX7BDJNn7JQagPBoFgDY+tmbfPfGc1hrexY3d1RekPuBQbn6nh66VIDMpOZeOSJ/QhKrK X-Received: by 2002:a17:906:8510:: with SMTP id i16mr499025ejx.234.1601380819159; Tue, 29 Sep 2020 05:00:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601380819; cv=none; d=google.com; s=arc-20160816; b=wPGGFCELd/YsdmQtTE7Mp0dBIu+pMLSannXzVIxrcDEiD/VP9d6jSnYXlaIZkNXV9p k2708k2QuAl2ZM44VDMW7bNTK13Nu3fT3VhngnW26zapzPhw+8Cs/sGAHgxaW7R3Pg5+ B5hhxmaeJ6mHcjjyNMhMBrxbTn8t3ZEdcS8pXIirXuHsHRArdTGpU26inMJ9Y9SEDFyW ceUQEYKngEL3YKOmyiJ040nXQi1G++Pc4FygAXJ8efqu4bUWz3Duf9RjPQ0Nr8BXLElJ N7lvssov78lPR2lHx72A5OjCKmTaco66w3YMBOLHNNRw6ugEI1sGXTJ1bLooLh1PvHXW DIWQ== 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 :message-id:date:subject:cc:to:from; bh=4DAqjYjZHT5AGxv0zw0XX1I1NeurIoNHBCXix2mdHhM=; b=ImmKHxxlamC+XGrZLlLfnphVy+SgELKFwmy1GYQ303u+NfsfV+IpEhggdKk8VH74dz EyCU8IORzhfYZEYmNwskjmbUSoqcpWXHgjdrlcxM248DcV9WedXyn47gGtYM5IS1k4k0 /I3Hdln2+ZhlzaJC/KNlRwIPELv/uKSpgliDtr1VcWqnfv/DgPat8msA6IL7HK/8a7sH Ey5+MDIPrVVR16CBR1OFJbYk8QvyhLHi/5zCfLWPfXrutXa9FPZaIh6FXe0U0OHIntQK QFCHxjuagm3EmV9dQT0qJzVFSH0NO6kxMAZyDlI5T6HpVYgXYep0pn9JJF8Hw18Xo+oH mbFw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k24si2515400eja.436.2020.09.29.04.59.55; Tue, 29 Sep 2020 05:00:19 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731633AbgI2L6r (ORCPT + 99 others); Tue, 29 Sep 2020 07:58:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730384AbgI2L6e (ORCPT ); Tue, 29 Sep 2020 07:58:34 -0400 Received: from smtp2-2.goneo.de (smtp2.goneo.de [IPv6:2001:1640:5::8:33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6486C061755 for ; Tue, 29 Sep 2020 04:58:33 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by smtp2.goneo.de (Postfix) with ESMTP id E9ECC23FE2D; Tue, 29 Sep 2020 13:58:29 +0200 (CEST) X-Virus-Scanned: by goneo X-Spam-Flag: NO X-Spam-Score: -2.999 X-Spam-Level: X-Spam-Status: No, score=-2.999 tagged_above=-999 tests=[ALL_TRUSTED=-1, AWL=-0.099, BAYES_00=-1.9] autolearn=ham Received: from smtp2.goneo.de ([127.0.0.1]) by localhost (smtp2.goneo.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SFliODkuL7_x; Tue, 29 Sep 2020 13:58:29 +0200 (CEST) Received: from lem-wkst-02.lemonage.de. (hq.lemonage.de [87.138.178.34]) by smtp2.goneo.de (Postfix) with ESMTPA id D39A723EE9F; Tue, 29 Sep 2020 13:58:28 +0200 (CEST) From: poeschel@lemonage.de To: Greg Kroah-Hartman , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org (open list) Cc: Lars Poeschel Subject: [PATCH] driver core: Remove double assignment Date: Tue, 29 Sep 2020 13:58:08 +0200 Message-Id: <20200929115808.2815382-1-poeschel@lemonage.de> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lars Poeschel This removes an assignment in device_add. It assigned the parent kobject to the kobject of the new device. This is not necessary, because the call to kobject_add a few lines later also does this same assignment. Signed-off-by: Lars Poeschel --- drivers/base/core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/base/core.c b/drivers/base/core.c index bb5806a2bd4c..03b5396cd192 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -2847,8 +2847,6 @@ int device_add(struct device *dev) error = PTR_ERR(kobj); goto parent_error; } - if (kobj) - dev->kobj.parent = kobj; /* use parent numa_node */ if (parent && (dev_to_node(dev) == NUMA_NO_NODE)) @@ -2856,7 +2854,7 @@ int device_add(struct device *dev) /* first, register with generic layer. */ /* we require the name to be set before, and pass NULL */ - error = kobject_add(&dev->kobj, dev->kobj.parent, NULL); + error = kobject_add(&dev->kobj, kobj, NULL); if (error) { glue_dir = get_glue_dir(dev); goto Error; -- 2.28.0