Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5675170rwd; Mon, 5 Jun 2023 07:07:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ75C6mpnP4m/hIcWBzppau0285e9TNrFw/+ioC6nmDO3fL5RxOP9bs6hAhl2CbyhzePiHSG X-Received: by 2002:a17:902:c40e:b0:1b0:25ab:a9eb with SMTP id k14-20020a170902c40e00b001b025aba9ebmr11743395plk.8.1685974050515; Mon, 05 Jun 2023 07:07:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685974050; cv=none; d=google.com; s=arc-20160816; b=r/qxunVHZWMjKykm0DAXOJyF3PHo5LPg27B84ptZZ82ArRW+8WlPUsoO4Im8XsO9GL 9xpvsnUteqX4NGcYOtw9U9WmEeswmzOBce75zn+NuVIHadt3lXRKmFWx9KIP3COPbIxR mCNsVkPIxTDVBPD4pfOPOw3xSkVQFeJOKtrumBcR4ng+wsnzfxu8xW4dBlKW0kgKe8l1 Da6JERFkkBIDuTbucxdJCpTKHsC0etHELkDKeLyJUVU2yUKRFCTzOoT3YdzGhoRw3wUu HilKwqiyDOXjdp32Oc9J2B6ahzp3C12UFDjBe7JKSOHHRW9Km7e7zqig5rm33uejgFmZ nvMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=JxwDQhCAuPGIb3iHcVUC4+fUCXLvKFtEBk4rG+JbNsE=; b=stZWvPYFYipBBYhOc8FSH0BKF35Eq17+osUWdzdVud/pKSbhLvJ350Tw9eCgH8qgmv PvIT/A104nvAHeBSC5ftewZ9QhniM5FADf0gsrGOTJ2qOjCo1xSOML9xs9zDNMyOzKt6 kH5PuhmY1/BCFadn49VoG6WCyiP4vzCmbRqAtGkIsj00uaFYPGIMVj6N3lE9KRa6GuDk Pl1o383NZeBQgH/aHUppqhQA/R9HU5ebT9dFK//yuxltHpFt7GJpuVxpqYOgsuwxuwze 9m3kOrqizFZzd/axNi/Gh16FF+Nzby7bmofSeG75sPKL7DormJqsmRwJLVztyslyhY/q RO5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pnkJLWSO; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w17-20020a170902e89100b001a24521e826si5667837plg.61.2023.06.05.07.07.12; Mon, 05 Jun 2023 07:07:30 -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; dkim=pass header.i=@linaro.org header.s=google header.b=pnkJLWSO; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231292AbjFENzg (ORCPT + 99 others); Mon, 5 Jun 2023 09:55:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231308AbjFENze (ORCPT ); Mon, 5 Jun 2023 09:55:34 -0400 Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68905B1 for ; Mon, 5 Jun 2023 06:55:33 -0700 (PDT) Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-651f2f38634so4298978b3a.0 for ; Mon, 05 Jun 2023 06:55:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685973333; x=1688565333; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=JxwDQhCAuPGIb3iHcVUC4+fUCXLvKFtEBk4rG+JbNsE=; b=pnkJLWSOGbzo1NvVO/8XOxioEO7TsaL5uds5covOj8vyRYu8Gz35EjX5v+BTx86tLE 3sI12/6C1e8jLWUR18wRea0ZREohGMNgpWqWeRzatJVsg4Y/5kJAcEn+d+kWjPYVJMUk IYN5lgjTLEChlQDU6s6ZweGIzGkYytSDQCiKtJR8KijFK+oSELp1uZDf+1mRIU+VTjqM Du2uEtHkc0PCwE1RFRtzckxjwBt3tI7vUkTa7j0PFyqa0OBOeTOFALDemwbYFWU01qIv Ao0em5bYtCHktzJ3ZJCZQDN9HnAWBTOIYVyA8e4fj3lKp8JGJXAqSzz6jQijhf3GNA5O SbaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685973333; x=1688565333; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=JxwDQhCAuPGIb3iHcVUC4+fUCXLvKFtEBk4rG+JbNsE=; b=lb1sAGskGpZubQSjukzcLBGgZmPSlIS8BaftU0Hktmvc1Xyh45RFraa83zD9vSQRko VaZPV3I6klou4PCQo9Xm2MUaGDa9pupuO3jZeYneW/PEXUU/bLjcsE13NDIi/yr/RM0v XoZLft+9Z98MQUUmd4JP20l1AhQdD+w9HJdvfoDBZBeC0IN3px+9kHMJa+NFFgPHCy/C 5gVH3hO6JSqnHigMYgRM+Ft5k6BBOl1ct0o/DMILg1qseeUPtP4fFdqp9l3SghZ/o3sC hBNf6Y41QBKIvjkxfNPzRtDvzT5knzm1vShmkVpu9ozbUdSg1/6tbkeomdFDEe9WwcSq ocHA== X-Gm-Message-State: AC+VfDxnpX7q2RJgLRRzseQ+liAaxepRsZBQnQgLMLuyzVYZzbRlYYZn DAmtF9N1jGDXjbyHEicd3yts X-Received: by 2002:a05:6a00:1501:b0:65a:6870:3acb with SMTP id q1-20020a056a00150100b0065a68703acbmr4472586pfu.31.1685973332897; Mon, 05 Jun 2023 06:55:32 -0700 (PDT) Received: from thinkpad ([120.138.12.115]) by smtp.gmail.com with ESMTPSA id d18-20020aa78152000000b00640e64aa9b7sm5417015pfn.10.2023.06.05.06.55.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Jun 2023 06:55:32 -0700 (PDT) Date: Mon, 5 Jun 2023 19:25:28 +0530 From: Manivannan Sadhasivam To: Lorenzo Pieralisi Cc: Damien Le Moal , kw@linux.com, kishon@kernel.org, bhelgaas@google.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: Re: [PATCH v6 2/9] PCI: endpoint: Pass EPF device ID to the probe function Message-ID: <20230605135528.GF5536@thinkpad> References: <20230602114756.36586-1-manivannan.sadhasivam@linaro.org> <20230602114756.36586-3-manivannan.sadhasivam@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On Mon, Jun 05, 2023 at 03:08:33PM +0200, Lorenzo Pieralisi wrote: > On Fri, Jun 02, 2023 at 09:13:25PM +0900, Damien Le Moal wrote: > > On 6/2/23 20:47, Manivannan Sadhasivam wrote: > > > Currently, the EPF probe function doesn't get the device ID argument needed > > > to correctly identify the device table ID of the EPF device. > > > > > > When multiple entries are added to the "struct pci_epf_device_id" table, > > > the probe function needs to identify the correct one. This is achieved by > > > modifying the pci_epf_match_id() function to return the match ID pointer > > > and passing it to the driver's probe function. > > > > > > pci_epf_device_match() function can return bool based on the return value > > > of pci_epf_match_id(). > > > > > > Reviewed-by: Kishon Vijay Abraham I > > > Signed-off-by: Manivannan Sadhasivam > > > > [...] > > > > > static int pci_epf_device_match(struct device *dev, struct device_driver *drv) > > > @@ -510,8 +510,12 @@ static int pci_epf_device_match(struct device *dev, struct device_driver *drv) > > > struct pci_epf *epf = to_pci_epf(dev); > > > struct pci_epf_driver *driver = to_pci_epf_driver(drv); > > > > > > - if (driver->id_table) > > > - return pci_epf_match_id(driver->id_table, epf); > > > + if (driver->id_table) { > > > + if (pci_epf_match_id(driver->id_table, epf)) > > > + return true; > > > + else > > > + return false; > > > > You prefer keeping this pattern ? > > > > return pci_epf_match_id(driver->id_table, epf) != NULL; > > > > is no much nicer ! > > s/no/so > > Yes it is, I can change it myself to spare Mani few cycles. > Please do! - Mani > Lorenzo > > > > > Anyway: > > > > Reviewed-by: Damien Le Moal > > > > -- > > Damien Le Moal > > Western Digital Research > > -- மணிவண்ணன் சதாசிவம்