From patchwork Tue May 15 14:26:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 913680 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 40lg7b2LTVz9ryk for ; Wed, 16 May 2018 00:34:35 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id F1A68C21E3E; Tue, 15 May 2018 14:30:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 1A5E7C21E26; Tue, 15 May 2018 14:29:08 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 4D9C3C21E57; Tue, 15 May 2018 14:28:13 +0000 (UTC) Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) by lists.denx.de (Postfix) with ESMTPS id 70FB9C21E63 for ; Tue, 15 May 2018 14:28:10 +0000 (UTC) Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 40lg0B22tbz1r1yD; Tue, 15 May 2018 16:28:10 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 40lg0B1bG2z1qx8J; Tue, 15 May 2018 16:28:10 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id V49ty0ubMHmM; Tue, 15 May 2018 16:28:09 +0200 (CEST) X-Auth-Info: flbSCCHiNBlpVt1hE5Uc30G6utewjM74SpldBvfp5wY= Received: from localhost.localdomain (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Tue, 15 May 2018 16:28:09 +0200 (CEST) From: Lukasz Majewski To: u-boot@lists.denx.de Date: Tue, 15 May 2018 16:26:42 +0200 Message-Id: <20180515142643.11599-11-lukma@denx.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180515142643.11599-1-lukma@denx.de> References: <20180515142643.11599-1-lukma@denx.de> Cc: Fabio Estevam , Tom Rini Subject: [U-Boot] [PATCH v3 10/11] sandbox: tests: Exclude common test code (pmic_get) in test/dm/pmic.c X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The common code can be excluded to be reused by tests for other PMIC. Signed-off-by: Lukasz Majewski Reviewed-by: Simon Glass --- Changes in v3: - None Changes in v2: - New patch test/dm/pmic.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/test/dm/pmic.c b/test/dm/pmic.c index b2061178fc..c24bd3b0a1 100644 --- a/test/dm/pmic.c +++ b/test/dm/pmic.c @@ -21,9 +21,9 @@ #include /* Test PMIC get method */ -static int dm_test_power_pmic_get(struct unit_test_state *uts) + +static inline int power_pmic_get(struct unit_test_state *uts, char *name) { - const char *name = "sandbox_pmic"; struct udevice *dev; ut_assertok(pmic_get(name, &dev)); @@ -34,6 +34,14 @@ static int dm_test_power_pmic_get(struct unit_test_state *uts) return 0; } + +/* Test PMIC get method */ +static int dm_test_power_pmic_get(struct unit_test_state *uts) +{ + power_pmic_get(uts, "sandbox_pmic"); + + return 0; +} DM_TEST(dm_test_power_pmic_get, DM_TESTF_SCAN_FDT); /* Test PMIC I/O */