From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0B6DFC79F82 for ; Tue, 8 Sep 2026 10:27:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=rn61n97doec59DKCZ6M6VofFM4uCXbRZMYDy/Eke7DU=; b=o2bEoG1CffA+3r ciy7fd304M5j9FWlg35l+Tw5JegBl9hZBw2x069mMNHueqspjlTh/IErPF3BkM8u0V82bIgNLEm1k R6g2yeg3PRS04x1k4oGG+iz6HX++r08w7Pjz1GSVFhVkZNeOTuaQI9013x6BW/HgN4PWpIIR0Y4kh dXfKF6zEjUNyJHkI/EwUQGeOBgQ426+x49yj1tFtjfD/B9w/b388tvOR2FwgCE1APwxAlJsD3Edhe oW/O2SJVuIKv0D2/VfJsFvibbYGHGFQWHaJoztFTQV3LYzHw9kUYNT0fQmzKp3TsgqEcl+AyvmJmy Rv1vjk+wYagHqn+lMzUA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1x3t2a-00000008leD-0psK; Tue, 08 Sep 2026 10:27:00 +0000 Received: from mgamail.intel.com ([198.175.65.14]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1x3t2X-00000008lcc-2zuM for linux-riscv@lists.infradead.org; Tue, 08 Sep 2026 10:26:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1788863217; x=1820399217; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=NRw+ETGIsTmdeUKeknoQ0Yj1vx+B3Gy2R9aH3D5k+KM=; b=BcAcKTpiKQlkZsiaATankA239UWSyHtFlV0PMGZkriJ5MoBX7ikgbCaO 0UhszUU83TeuTFK39Q8W/nM4jL2HUh4mAlCA2mLJXKOjomr5gKxqx5kJG kTsA1J0RqUW25YklZozDu2H2/xoBQs1+RSf72LWJsToziqEGqMkKsMHlc PS3IVvOo6kQqeATPyAaK8tZRZNRzhZ8hjW99RTI+soF6uhaonsG8L1gOy eq4yLdWit+g4P7JZmlEtK2fsiYFGI3EKOLaeEVGvw/sGW9zDUq761XwoJ Vj8/HuR3JPeMkiSG1kxK7lzmQcgWzQs+zzS1qhQRFLThpZP44JsjHi89E A==; X-CSE-ConnectionGUID: o/yyZ44mS7aRhB00iuAsag== X-CSE-MsgGUID: A9Rtr+gATYuZap8Rh//izQ== X-IronPort-AV: E=McAfee;i="6800,10657,11899"; a="93125274" X-IronPort-AV: E=Sophos;i="6.25,268,1779174000"; d="scan'208";a="93125274" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Sep 2026 03:26:54 -0700 X-CSE-ConnectionGUID: AWLCOjaVT36BCPSmrDCMmQ== X-CSE-MsgGUID: NbW/xd5MTgKX83yqBbb0VQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,268,1779174000"; d="scan'208";a="271468162" Received: from smoticic-mobl1.ger.corp.intel.com (HELO localhost) ([10.245.244.92]) by orviesa009-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Sep 2026 03:26:47 -0700 Date: Tue, 8 Sep 2026 13:26:44 +0300 From: Andy Shevchenko To: Inochi Amaoto Cc: Jingoo Han , Manivannan Sadhasivam , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Krzysztof Kozlowski , Conor Dooley , Yixun Lan , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Frank Li , Niklas Cassel , Sherry Sun , Arnd Bergmann , Christian Bruel , Krishna Chaitanya Chundru , Senchuan Zhang , Alex Elder , Xincheng Zhang , Randolph Lin , Siddharth Vadapalli , Vidya Sagar , Neil Armstrong , Danilo Krummrich , Uwe =?iso-8859-1?Q?Kleine-K=F6nig_=28The_Capable_Hub=29?= , Pengpeng Hou , Anirudh Srinivasan , Gustavo Pimentel , linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, spacemit@lists.linux.dev, Yixun Lan , Longbin Li Subject: Re: [PATCH v5 1/6] PCI: spacemit-k1: Add device data support Message-ID: References: <20260907112606.465778-1-inochiama@gmail.com> <20260907112606.465778-2-inochiama@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20260907112606.465778-2-inochiama@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260908_032657_795264_2A49E09F X-CRM114-Status: GOOD ( 13.00 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Mon, Sep 07, 2026 at 07:26:00PM +0800, Inochi Amaoto wrote: > To reuse the K1 PCIe driver logic for K3 PCIe controller, add device > data to handle the K1 specific logic and make room for the incoming > logic for K3. ... > static int k1_pcie_probe(struct platform_device *pdev) > { > + const struct k1_pcie_device_data *data; > struct device *dev = &pdev->dev; > struct k1_pcie *k1; > int ret; > > + data = device_get_match_data(dev); > + if (!data) > + return -ENODEV; It's better to use -ENODATA which will help to distinguish from other ENODEV cases (which are more often to happen). > k1 = devm_kzalloc(dev, sizeof(*k1), GFP_KERNEL); > if (!k1) > return -ENOMEM; -- With Best Regards, Andy Shevchenko _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv