From patchwork Sat Oct 3 15:25:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1376281 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=OBIGWIGp; 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)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4C3W142Dxvz9s1t for ; Sun, 4 Oct 2020 01:26:32 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6AA2A82361; Sat, 3 Oct 2020 17:26:04 +0200 (CEST) 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="OBIGWIGp"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 621FC82334; Sat, 3 Oct 2020 17:26:00 +0200 (CEST) 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,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x141.google.com (mail-il1-x141.google.com [IPv6:2607:f8b0:4864:20::141]) (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 EEE7982334 for ; Sat, 3 Oct 2020 17:25:56 +0200 (CEST) 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-x141.google.com with SMTP id j13so3948924ilc.4 for ; Sat, 03 Oct 2020 08:25:56 -0700 (PDT) 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=16GP/csw9c1So5ITySwfUVIKSR2iNloOn9q07xbc0PQ=; b=OBIGWIGp6uDQEnpWT7/DWTNfjnNB2+PGiU/W3JTO17JUSfILKZeFx9QZAf0Ptu0JLb hXaSHw/Y1eP94DOjbtGijwsBPkNE7T7aoKgx9LF1fPHb27FFMJQLEEWFnJNLCGxOnwZD Omscb3gReJwjnvlk2FwaJEyje/50XT9P484zg= 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=16GP/csw9c1So5ITySwfUVIKSR2iNloOn9q07xbc0PQ=; b=BXGm+tkL15IrFU7DZWXu01duLUSnTlf9aaWZesJjsXnYrvr0Nh4m4JzgPGMjNf+1yc VYrj1zDTwMGSwzpejDTUgQjDLFLWE3idHESITooYg/JHE/qlTXqjHGlNWOwJ3W+F2zq6 +NwewbFZ0XFtsPkrYsd0hn7Rmq+BmTvqVinKEcFBkpQGoAxHxIWOMNP97s8GBhcfpcEy +lj8tsnuYYttmVIfPMTSWvA5D0jIws4Mr6/hSQyFw8r1H9j3GuwVn7mfzgIPFfcYsNtj 35EKnjovBhqRwkjll2OV3MpfYjHEanGGYEtlRapyTuFm4CzMV5I01yNcSo86tVo5s0MA jhtQ== X-Gm-Message-State: AOAM53105Rm4PezuJrNLH6Da+mNtJWp4QfxL1zp9RNDV2eqC1zZqlzmD I5raikRy14pKBnL9XfTZMAM3YnQusxshdRFg X-Google-Smtp-Source: ABdhPJxGe1PAFfHfjszUoWx5P2YkIA22IotaOtJ2VqHOj2bL+tDfIOmB5M2i25uJxlooI9d3iQPtIg== X-Received: by 2002:a92:c951:: with SMTP id i17mr5448061ilq.158.1601738755728; Sat, 03 Oct 2020 08:25:55 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id l77sm2099558ill.4.2020.10.03.08.25.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Oct 2020 08:25:55 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Marek Vasut , Pavel Herrmann Subject: [PATCH 03/17] dm: core: Expand the comment for DM_GET_DEVICE() Date: Sat, 3 Oct 2020 09:25:20 -0600 Message-Id: <20201003152534.3184504-4-sjg@chromium.org> X-Mailer: git-send-email 2.28.0.806.g8561365e88-goog In-Reply-To: <20201003152534.3184504-1-sjg@chromium.org> References: <20201003152534.3184504-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 The current documentation for this is not particularly enlightening. Add a little more detail. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- include/dm/platdata.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/include/dm/platdata.h b/include/dm/platdata.h index cab93b071ba..25479b03d22 100644 --- a/include/dm/platdata.h +++ b/include/dm/platdata.h @@ -45,7 +45,22 @@ struct driver_info { #define U_BOOT_DEVICES(__name) \ ll_entry_declare_list(struct driver_info, __name, driver_info) -/* Get a pointer to a given driver */ +/** + * Get a pointer to a given device info given its name + * + * With the declaration U_BOOT_DEVICE(name), DM_GET_DEVICE(name) will return a + * pointer to the struct driver_info created by that declaration. + * + * if OF_PLATDATA is enabled, from this it is possible to use the @dev member of + * struct driver_info to find the device pointer itself. + * + * TODO(sjg@chromium.org): U_BOOT_DEVICE() tells U-Boot to create a device, so + * the naming seems sensible, but DM_GET_DEVICE() is a bit of misnomer, since it + * finds the driver_info record, not the device. + * + * @__name: Driver name (C identifier, not a string. E.g. gpio7_at_ff7e0000) + * @return struct driver_info * to the driver that created the device + */ #define DM_GET_DEVICE(__name) \ ll_entry_get(struct driver_info, __name, driver_info)