From patchwork Sun Nov 29 00:50:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1407757 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=f1RWfxhk; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Ck8tZ50Fgz9sSn for ; Sun, 29 Nov 2020 11:51:01 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 00BBF8270E; Sun, 29 Nov 2020 01:50:41 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="f1RWfxhk"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 91D6E82730; Sun, 29 Nov 2020 01:50:34 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x142.google.com (mail-il1-x142.google.com [IPv6:2607:f8b0:4864:20::142]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 98C3E8270E for ; Sun, 29 Nov 2020 01:50:30 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x142.google.com with SMTP id f5so7923514ilj.9 for ; Sat, 28 Nov 2020 16:50:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LHi71cgCPt2icwGubCu0Itc5i7q64USaDE1rN0+mSy0=; b=f1RWfxhktoIPTePqVjm//yQVIFYpWbpjjmSq0T+K15pnpDUPrJPvHTMPxjvsCMTHwr 8uipbQohvJJPlP3rK9tk2CItkSeplpWiRW7xFr3EmaMdVUzhVLWaq/igAkNRx7l2k0vM m2k6lQ/c7lGFIKfjAc8jIR2cQ5AdubNggvjIY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LHi71cgCPt2icwGubCu0Itc5i7q64USaDE1rN0+mSy0=; b=OHTEFBN7kqoLiqHf9KOCgxAjuChuVj26pr5H/FWP5mhk15dPgIQYZ7wcSj2gsEdQjq 2grNP19MR+DSuv++mVZI6+4UB6WYyZNZPbfisxYxV2zE1RYYYh7O2vkJscEm1xupu8vL kF2SHd7F2LRVjzspa0cYp6kYBeLQD7uiEIQ4LVbxIV98JIh2EoiQSJ4dN8rpMFcZw5kj X32IbkfgjlEoLZ6fV7F5/LRUU5sa2NKsfz89iuFxq/oTgdQUIHt2FWnjbSOqE1w8OsJQ eHFzCJWgtpUTZBrDLkJ5T9R8Att0gpqggb4UmFNa5VQNaV5KbFaiwSvWEuEFb3Y/mYln nitQ== X-Gm-Message-State: AOAM530n60E4RCDRW/nw65GUJ/ulNIyTY+hKACuDd2LOl2hE/x76k0pX Gua0WDb9Zdk+zQrpGLa/8dn8DYH6A986/g== X-Google-Smtp-Source: ABdhPJyCc75C2fhUTNnKwN4l47c8N79/ji1piMyhXJiD/8sU0lXbz03Ug8dZFKqSxFOd9DixpK5nFg== X-Received: by 2002:a92:6403:: with SMTP id y3mr13670429ilb.72.1606611029195; Sat, 28 Nov 2020 16:50:29 -0800 (PST) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id s4sm5807982iop.21.2020.11.28.16.50.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Nov 2020 16:50:28 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Anatolij Gustschin , Andy Shevchenko , Bin Meng , Etienne Carriere , Eugen Hristev , Heiko Schocher , Jagan Teki , Ley Foon Tan , Marek Vasut , Masahiro Yamada , Michael Walle , Michal Simek , Pavel Herrmann , Peng Fan , Rayagonda Kokatanur , Robert Beckett , Sean Anderson , Stefan Roese , Suneel Garapati , Vignesh R , Ye Li Subject: [PATCH 02/11] dm: core: Rename device_bind_ofnode() to device_bind() Date: Sat, 28 Nov 2020 17:50:01 -0700 Message-Id: <20201128174958.2.Ib100c98f398ec68c4b7e04ade5493c5819c7dbce@changeid> X-Mailer: git-send-email 2.29.2.454.gaff20da3a2-goog In-Reply-To: <20201129005011.2104545-1-sjg@chromium.org> References: <20201129005011.2104545-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean This is the standard function to use when binding devices. Drop the '_ofnode' suffix to make this clear. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- drivers/core/device.c | 6 +++--- drivers/firmware/scmi/scmi_agent-uclass.c | 4 ++-- drivers/gpio/dwapb_gpio.c | 4 ++-- drivers/misc/i2c_eeprom.c | 4 ++-- drivers/mtd/spi/sandbox.c | 2 +- drivers/pci/pci-uclass.c | 4 ++-- drivers/pci/pci_mvebu.c | 4 ++-- drivers/usb/host/usb-uclass.c | 4 ++-- include/dm/device-internal.h | 6 +++--- test/dm/core.c | 4 ++-- 10 files changed, 21 insertions(+), 21 deletions(-) diff --git a/drivers/core/device.c b/drivers/core/device.c index 081dd1f7780..c8a219d77b3 100644 --- a/drivers/core/device.c +++ b/drivers/core/device.c @@ -240,9 +240,9 @@ int device_bind_offset(struct udevice *parent, const struct driver *drv, offset_to_ofnode(of_offset), 0, devp); } -int device_bind_ofnode(struct udevice *parent, const struct driver *drv, - const char *name, void *platdata, ofnode node, - struct udevice **devp) +int device_bind(struct udevice *parent, const struct driver *drv, + const char *name, void *platdata, ofnode node, + struct udevice **devp) { return device_bind_common(parent, drv, name, platdata, 0, node, 0, devp); diff --git a/drivers/firmware/scmi/scmi_agent-uclass.c b/drivers/firmware/scmi/scmi_agent-uclass.c index 7dc533149b6..b3d3f0a51b0 100644 --- a/drivers/firmware/scmi/scmi_agent-uclass.c +++ b/drivers/firmware/scmi/scmi_agent-uclass.c @@ -89,8 +89,8 @@ static int scmi_bind_protocols(struct udevice *dev) continue; } - ret = device_bind_ofnode(dev, drv, ofnode_get_name(node), - NULL, node, NULL); + ret = device_bind(dev, drv, ofnode_get_name(node), NULL, node, + NULL); if (ret) break; } diff --git a/drivers/gpio/dwapb_gpio.c b/drivers/gpio/dwapb_gpio.c index 37916e77716..cf20a5024e0 100644 --- a/drivers/gpio/dwapb_gpio.c +++ b/drivers/gpio/dwapb_gpio.c @@ -202,8 +202,8 @@ static int gpio_dwapb_bind(struct udevice *dev) } } - ret = device_bind_ofnode(dev, dev->driver, plat->name, - plat, node, &subdev); + ret = device_bind(dev, dev->driver, plat->name, plat, node, + &subdev); if (ret) return ret; diff --git a/drivers/misc/i2c_eeprom.c b/drivers/misc/i2c_eeprom.c index 3651ba4871e..92e18356254 100644 --- a/drivers/misc/i2c_eeprom.c +++ b/drivers/misc/i2c_eeprom.c @@ -131,8 +131,8 @@ static int i2c_eeprom_std_bind(struct udevice *dev) if (!name) continue; - device_bind_ofnode(dev, DM_GET_DRIVER(i2c_eeprom_partition), - name, NULL, partition, NULL); + device_bind(dev, DM_GET_DRIVER(i2c_eeprom_partition), name, + NULL, partition, NULL); } return 0; diff --git a/drivers/mtd/spi/sandbox.c b/drivers/mtd/spi/sandbox.c index 0b602dc9140..1d0c1cb3fa2 100644 --- a/drivers/mtd/spi/sandbox.c +++ b/drivers/mtd/spi/sandbox.c @@ -538,7 +538,7 @@ int sandbox_sf_bind_emul(struct sandbox_state *state, int busnum, int cs, str = strdup(name); if (!str) return -ENOMEM; - ret = device_bind_ofnode(bus, drv, str, NULL, node, &emul); + ret = device_bind(bus, drv, str, NULL, node, &emul); if (ret) { free(str); printf("Cannot create emul device for spec '%s' (err=%d)\n", diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c index eb07d253011..9230cfe88b5 100644 --- a/drivers/pci/pci-uclass.c +++ b/drivers/pci/pci-uclass.c @@ -750,8 +750,8 @@ static int pci_find_and_bind_driver(struct udevice *parent, * find another driver. For now this doesn't seem * necesssary, so just bind the first match. */ - ret = device_bind_ofnode(parent, drv, drv->name, NULL, - node, &dev); + ret = device_bind(parent, drv, drv->name, NULL, node, + &dev); if (ret) goto error; debug("%s: Match found: %s\n", __func__, drv->name); diff --git a/drivers/pci/pci_mvebu.c b/drivers/pci/pci_mvebu.c index c9afe751501..ba1c139dbc5 100644 --- a/drivers/pci/pci_mvebu.c +++ b/drivers/pci/pci_mvebu.c @@ -501,8 +501,8 @@ static int mvebu_pcie_bind(struct udevice *parent) return -ENOMEM; /* Create child device UCLASS_PCI and bind it */ - device_bind_ofnode(parent, &pcie_mvebu_drv, pcie->name, pcie, - subnode, &dev); + device_bind(parent, &pcie_mvebu_drv, pcie->name, pcie, subnode, + &dev); } return 0; diff --git a/drivers/usb/host/usb-uclass.c b/drivers/usb/host/usb-uclass.c index 8773824e057..2f8c9037c12 100644 --- a/drivers/usb/host/usb-uclass.c +++ b/drivers/usb/host/usb-uclass.c @@ -581,8 +581,8 @@ static int usb_find_and_bind_driver(struct udevice *parent, * find another driver. For now this doesn't seem * necesssary, so just bind the first match. */ - ret = device_bind_ofnode(parent, drv, drv->name, NULL, - node, &dev); + ret = device_bind(parent, drv, drv->name, NULL, node, + &dev); if (ret) goto error; debug("%s: Match found: %s\n", __func__, drv->name); diff --git a/include/dm/device-internal.h b/include/dm/device-internal.h index 59d3be09a1e..636210f73ed 100644 --- a/include/dm/device-internal.h +++ b/include/dm/device-internal.h @@ -40,9 +40,9 @@ int device_bind_offset(struct udevice *parent, const struct driver *drv, const char *name, void *platdata, int of_offset, struct udevice **devp); -int device_bind_ofnode(struct udevice *parent, const struct driver *drv, - const char *name, void *platdata, ofnode node, - struct udevice **devp); +int device_bind(struct udevice *parent, const struct driver *drv, + const char *name, void *platdata, ofnode node, + struct udevice **devp); /** * device_bind_with_driver_data() - Create a device and bind it to a driver diff --git a/test/dm/core.c b/test/dm/core.c index 6f380a574cf..ba9e60d09cb 100644 --- a/test/dm/core.c +++ b/test/dm/core.c @@ -1052,8 +1052,8 @@ static int dm_test_inactive_child(struct unit_test_state *uts) */ ut_asserteq(-ENODEV, device_find_first_inactive_child(parent, UCLASS_TEST, &dev1)); - ut_assertok(device_bind_ofnode(parent, DM_GET_DRIVER(test_drv), - "test_child", 0, ofnode_null(), &dev1)); + ut_assertok(device_bind(parent, DM_GET_DRIVER(test_drv), + "test_child", 0, ofnode_null(), &dev1)); ut_assertok(device_find_first_inactive_child(parent, UCLASS_TEST, &dev2));