Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp47353rwi; Thu, 13 Oct 2022 21:07:27 -0700 (PDT) X-Google-Smtp-Source: AMsMyM57bjo9fK0yvpnng9AC1bfLxTwakJQrExz3tusAOQIiEic7NafAr8ewugp9R0HF1DUFvTk3 X-Received: by 2002:a17:907:96a0:b0:78d:dd45:a6d4 with SMTP id hd32-20020a17090796a000b0078ddd45a6d4mr2066466ejc.643.1665720447350; Thu, 13 Oct 2022 21:07:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665720447; cv=none; d=google.com; s=arc-20160816; b=UcoUz//K1xCy5CK1a2jm8/Hj5NrLnL7+tIu3+Bz4tCsO72q5Q1FUd5+FqOA1+3vtrB YD4+v+YAvjMLsf3i7ZVhqRscDOiaRyWf7fnk3e7ULp3rprBwHE5c8uxPpYcBPm37rsk/ SptRr3c/JVJJW0peqP5LEbvrfx+TAH38c9OFuoIKkUnKwoFRBv1MBUJgde8NxrszmHIL cvoQ4bm2HJYapM1QCQCR/k6hkND0mJNiu1o0ix+NABQl/g6uXzkn+sR7FD5r+BcRRE9+ dUT4ZH6Gz8PNa1a9tKwDyLpk6+mvHSJFWyUgDr4Qn+IQyflUbEQoDTgofSG+G9s6V1en 88JQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=+37Uyhu2KMx4CGR0jHjV3Ul0MgjtXs2plozyqwzBDrs=; b=vHQkF4Qt4ILEnjQAi3v8ovq6eyvSRjncERs7ci89iTDA86RfgHCpm6kTC6cjVzC8wV UFP4KGZwv67xgnKRRecSo1W9CLWLiZ7SLGlanxjUaaTehBEXLNk3BrS/+wdhA7eXp561 Rg3nvGJbyrFnxq+lH6x7czVZU5vUlorUjeZWzaDZcnhVeEN2p8xiWU1v3l/L+z5zWOlP W0LI6D/0wSd5chY7e3d/V7EMzmzzpFtBGz7FdVX7Ox8D/DhzBFenX9u35Zp0hpnM/rLP iOnlc6eRedSD+9ag4rmYJkPL2QcRCPBnLn6HccoaumsYslrMN9Yr3sGZJ/UwipwI+x13 1Rag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ne37-20020a1709077ba500b0078def76da94si1164180ejc.437.2022.10.13.21.07.01; Thu, 13 Oct 2022 21:07:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229716AbiJNEA6 (ORCPT + 99 others); Fri, 14 Oct 2022 00:00:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229618AbiJNEA5 (ORCPT ); Fri, 14 Oct 2022 00:00:57 -0400 Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DCCCED998; Thu, 13 Oct 2022 21:00:56 -0700 (PDT) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id AE8AC216FCA; Fri, 14 Oct 2022 06:00:54 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 780F4217048; Fri, 14 Oct 2022 06:00:54 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 541551820F5B; Fri, 14 Oct 2022 12:00:53 +0800 (+08) From: Shengjiu Wang To: andersson@kernel.org, mathieu.poirier@linaro.org, arnaud.pouliquen@foss.st.com Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, shengjiu.wang@gmail.com Subject: [PATCH v2] remoteproc: core: Auto select rproc-virtio device id Date: Fri, 14 Oct 2022 11:40:51 +0800 Message-Id: <1665718851-22341-1-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 With multiple remoteproc device, there will below error: sysfs: cannot create duplicate filename '/bus/platform/devices/rproc-virtio.0' The rvdev_data.index is duplicate, that cause issue, so need to use the PLATFORM_DEVID_AUTO instead. After fixing device name it becomes something like: /bus/platform/devices/rproc-virtio.2.auto Fixes: 1d7b61c06dc3 ("remoteproc: virtio: Create platform device for the remoteproc_virtio") Signed-off-by: Shengjiu Wang Reviewed-by: Arnaud Pouliquen Reviewed-by: Mukesh Ojha Tested-by: Peng Fan --- changes in v2: - update commit message drivers/remoteproc/remoteproc_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 8768cb64f560..03a26498e879 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -509,7 +509,7 @@ static int rproc_handle_vdev(struct rproc *rproc, void *ptr, rvdev_data.rsc_offset = offset; rvdev_data.rsc = rsc; - pdev = platform_device_register_data(dev, "rproc-virtio", rvdev_data.index, &rvdev_data, + pdev = platform_device_register_data(dev, "rproc-virtio", PLATFORM_DEVID_AUTO, &rvdev_data, sizeof(rvdev_data)); if (IS_ERR(pdev)) { dev_err(dev, "failed to create rproc-virtio device\n"); -- 2.34.1