Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp2185213rdh; Tue, 26 Sep 2023 15:37:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFY8Q4FCZaj5yoy0svGWTrBttfwK62QYRc/OckWsB9hx8iGCdVu5nmVtsTDx0NLp9bqh3T5 X-Received: by 2002:a05:6359:630:b0:143:4e76:7e5b with SMTP id eh48-20020a056359063000b001434e767e5bmr393997rwb.3.1695767860473; Tue, 26 Sep 2023 15:37:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695767860; cv=none; d=google.com; s=arc-20160816; b=uFg+5wfoz6o9lFNKjTy0jxETOg5tWszJdRcVJoARh4gAMTudqTsunDP7MfU2c3wD3X aNawhVQ6jDUUpfNPtdmlKR6YnnUqjITTzHqn7FPM2iAIn21fFKwmSw4p0sYIFDPfLrJy nBn/elv6X+xI/FWsgnY0Wp6rOoF7sXE9J9X/B9NjfOiqBwg1nmW/6qWa0VDFQ9eMD4tO e6AV8ZttYl+F6HC7z4rpfFQJBhDgklyEYkadI7iX8a4P54ZqnY7RRy19qUQ8CSLtODlU ncWo7Pchna9eGh3lkwm67kB0yMyaGyMvV4KhRkIbj15ddt1o4nLsWIOB4L/ZUmWPEf+V 68wg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=av4Q5tr0bnozwSJldJa/tKMZzYdZGmoPuhbGkeCDqlg=; fh=vL6Moim7ujQ71QOBXYMaaPnG1N9WYgskJqrZSTruGY4=; b=Lk509njIoAXH6CsCnuEcFU1pZdDCuVELU5ZgQbgtuIYQHeG3U6CuOEaaRW90GhIxUA O0B0wynMKXZj5OVR5HLv63TbH5OkJydymi73NcSXvnxyE1lhPhyVb7gk2h997K1ydwmO OY5+X4lAXIDSBunr8b+0EgnBPtJb8m8Ph2PbJxgVxpKGc4oYeFE2VJ7kk4MGF0HPCRyc MIAL2MXUtFC2Q0HjM4yW9cVgIxsdRM1Z9+4tApOm581NvYA3YzrBJcFmsGJ+Uv0p6xJx bFHd9ah7wDAa35Aj65m/j5RZOerf2og9ZCA1+htyVYy8EPE9B3qv9iAgvag/S/IKi8+5 p+sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iqTAIiHu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id v70-20020a638949000000b00577a9ed62edsi14089096pgd.419.2023.09.26.15.37.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 15:37:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iqTAIiHu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id EB58081C7AA0; Tue, 26 Sep 2023 09:40:13 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235354AbjIZQkQ (ORCPT + 99 others); Tue, 26 Sep 2023 12:40:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235319AbjIZQkM (ORCPT ); Tue, 26 Sep 2023 12:40:12 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF99A13A for ; Tue, 26 Sep 2023 09:39:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695746365; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=av4Q5tr0bnozwSJldJa/tKMZzYdZGmoPuhbGkeCDqlg=; b=iqTAIiHu1L5lsyMuMYmLo9rlkzA14940/mL6uHrTALweAdGUiFBpyUscoySoYDu6TD1YZq 5/twkDvqivabkP23XEWqHJSpERcPjN//x4x9RgszEAry2aehAwx8IfovaFyvZIYjwf3oag xkGRQN3kRkN+Tm/FC3x2Bh2c05y/QLE= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-275-QQJJ75rdNhuIs1BMOT2tiQ-1; Tue, 26 Sep 2023 12:39:23 -0400 X-MC-Unique: QQJJ75rdNhuIs1BMOT2tiQ-1 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-32006e08483so7257776f8f.0 for ; Tue, 26 Sep 2023 09:39:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695746362; x=1696351162; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=av4Q5tr0bnozwSJldJa/tKMZzYdZGmoPuhbGkeCDqlg=; b=qBbcqzKNrFF0f/Xqwmg+1v2r22YWrun666/WejoyckccvjPuQTs1iYJO7d4MUyQpGb DvxrJo5aM9JS892yf1emryzA3hkovxAP112hG8L4amuPixnpUUWtZMbpyHzfPdGb07Ym iXwIwJtI8j5pWyiPX4NCwdqMQcT9KDzXuHgeeChj63GCgSYzdgoGRKE7Tep7CP9tHnN9 3BYSVWuCfOGzUhg0tTD9PbAN2QYHMCglW7kg4wt5hNCCOqpJDHrwQHMZrD2+7t0XnNl4 66r9j3YCD3+WmxgTbgHQsPUMEdqR9fD9kmkqUc2/Osyc3Wrg+jy9s8VFAcHjF700sEj8 QfXw== X-Gm-Message-State: AOJu0Yy2SimQBK557IRW/2tzY4t3HqmHfgf5DUvh3s6P082J+pQd3Rz+ Fjpt2ze9WERUolsyuElSumyaB45vMUGZsf5maWDsmQrektGK/RtauGTYFa/qS6PZLCW9XqfW504 jMFn31RiqSk2RUrILBOdAzNY= X-Received: by 2002:adf:f891:0:b0:320:66:cf67 with SMTP id u17-20020adff891000000b003200066cf67mr8551634wrp.18.1695746362264; Tue, 26 Sep 2023 09:39:22 -0700 (PDT) X-Received: by 2002:adf:f891:0:b0:320:66:cf67 with SMTP id u17-20020adff891000000b003200066cf67mr8551628wrp.18.1695746362039; Tue, 26 Sep 2023 09:39:22 -0700 (PDT) Received: from klayman.redhat.com (net-2-34-30-58.cust.vodafonedsl.it. [2.34.30.58]) by smtp.gmail.com with ESMTPSA id w10-20020adfde8a000000b0031fba0a746bsm15171803wrl.9.2023.09.26.09.39.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 09:39:21 -0700 (PDT) From: Marco Pagani To: Moritz Fischer , Wu Hao , Xu Yilun , Tom Rix Cc: Marco Pagani , linux-kernel@vger.kernel.org, linux-fpga@vger.kernel.org Subject: [PATCH 1/4] fpga: add helpers for the FPGA KUnit test suites. Date: Tue, 26 Sep 2023 18:39:08 +0200 Message-ID: <20230926163911.66114-2-marpagan@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230926163911.66114-1-marpagan@redhat.com> References: <20230926163911.66114-1-marpagan@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 26 Sep 2023 09:40:14 -0700 (PDT) Add helpers to facilitate the registration of minimal platform drivers to support the parent platform devices used for testing. Signed-off-by: Marco Pagani --- drivers/fpga/tests/fpga-test-helpers.h | 29 ++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 drivers/fpga/tests/fpga-test-helpers.h diff --git a/drivers/fpga/tests/fpga-test-helpers.h b/drivers/fpga/tests/fpga-test-helpers.h new file mode 100644 index 000000000000..fcad3249be68 --- /dev/null +++ b/drivers/fpga/tests/fpga-test-helpers.h @@ -0,0 +1,29 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * KUnit test for the FPGA Manager + * + * Copyright (C) 2023 Red Hat, Inc. + * + * Author: Marco Pagani + */ + +#ifndef FPGA_KUNIT_HELPERS_ +#define FPGA_KUNIT_HELPERS_ + +#define TEST_PDEV_NAME "fpga-test-pdev" + +#define TEST_PLATFORM_DRIVER(__drv_name) \ + __TEST_PLATFORM_DRIVER(__drv_name, TEST_PDEV_NAME) +/* + * Helper macro for defining a minimal platform driver that can + * be registered to support the parent platform devices used for + * testing. + */ +#define __TEST_PLATFORM_DRIVER(__drv_name, __dev_name) \ +static struct platform_driver __drv_name = { \ + .driver = { \ + .name = __dev_name, \ + }, \ +} + +#endif /* FPGA_KUNIT_HELPERS_ */ -- 2.41.0