Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1094783ybi; Fri, 12 Jul 2019 09:37:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqwLZ3iYeeNKQ3VUwn6OJ2dkAssJpgcUOyCHhD/Y+LoTT3ABTTXwpHBf4clSb5NHalkc9lG4 X-Received: by 2002:a17:902:704c:: with SMTP id h12mr11924176plt.318.1562949425642; Fri, 12 Jul 2019 09:37:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562949425; cv=none; d=google.com; s=arc-20160816; b=QFMEq8hxlj6uedorikq5eb0S53/CtsWt95MjIytzGM9QwqZsDBUZ+KvNRqx8UnbsrK EFLVU7UWdDJeVHlCgVkNzCiY5JUQCmICpm8J11ET8eokFAIJjVH0lTvTRhwOKoxjZSrE zB/Z0vALe4TV2ykw3iHHi5DVJWbjc2V6+zz2ojegQHPSylVdQMKEVrQptP05P/fJ6zvG BOrUdnpLb0gE/lz+vC7LLYqVXJAcO4mlbcKhtZdQpTZNTt92f0TDbe8AjwY+ni6OXg6N fNkaPchSEBXCvl0waEXfG9zY2q1QYglJhqAyUwThfmyGkZFHTLXJvqqV+kM412rLps9h KVRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=xw9kzgg+648jBOiJz58z14M8bTNMpemIcbAE5VUxJVI=; b=0mztHkbuIDyHdAbgHTHWRu18gMiPy5sWXV4m0ysOUVJeE/PN6dTfHj2ALxKDr47u/E +kp8bWmo3udOBnQFjtL+hNWlDWqnRcWcZSmzH8RB98LUbZTZTN+ck5xW2TRgy0ApgJFT PARfnUugNlLUUjqc3aVVcRh+JFb7f/ErfJatzT2oyJ7ymuwz+3AFUDxmdtk3zGvmKdcd 1EdwPJBOu1Xl6csEMYZRX5qInvb0T+cA+JXPuQlU2aOLr0iqXPMGIcvx0i//jkqaddgt Mk+Jj1oep2KnWRjWo/XU4pTJISIxOM4k5FTEu+GyolKXmEVnMcVzp0iqX6dUAwnZ/w2a mHIQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 67si3146659plf.400.2019.07.12.09.36.50; Fri, 12 Jul 2019 09:37:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727342AbfGLQem (ORCPT + 99 others); Fri, 12 Jul 2019 12:34:42 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:51288 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726449AbfGLQem (ORCPT ); Fri, 12 Jul 2019 12:34:42 -0400 Received: from pc-381.home (2a01cb0c80061e00e835b5cf688fec09.ipv6.abo.wanadoo.fr [IPv6:2a01:cb0c:8006:1e00:e835:b5cf:688f:ec09]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bbrezillon) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 04013274268; Fri, 12 Jul 2019 17:34:39 +0100 (BST) Date: Fri, 12 Jul 2019 18:34:36 +0200 From: Boris Brezillon To: Vitor Soares Cc: "Joao.Pinto@synopsys.com" , "rafael@kernel.org" , "linux-iio@vger.kernel.org" , "gregkh@linuxfoundation.org" , "bbrezillon@kernel.org" , "linux-kernel@vger.kernel.org" , "linux-i3c@lists.infradead.org" , "lorenzo@kernel.org" Subject: Re: [PATCH v4 2/3] i3c: move i3c_device_match_id to device.c and export it Message-ID: <20190712183436.1b3d3cf5@pc-381.home> In-Reply-To: References: <20190712180338.47b50e9f@linux.home> Organization: Collabora X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 12 Jul 2019 16:21:49 +0000 Vitor Soares wrote: > > > > You're missing a kerneldoc here. > > I will do that. Can you clarify why we need that? > So the function is properly documented here [1]. > > > > > +const struct i3c_device_id * > > > +i3c_device_match_id(struct i3c_device *i3cdev, > > > + const struct i3c_device_id *id_table) > > > +{ > > > + struct i3c_device_info devinfo; > > > + const struct i3c_device_id *id; > > > + > > > + i3c_device_get_info(i3cdev, &devinfo); > > > + > > > + /* > > > + * The lower 32bits of the provisional ID is just filled with a random > > > + * value, try to match using DCR info. > > > + */ > > > + if (!I3C_PID_RND_LOWER_32BITS(devinfo.pid)) { > > > + u16 manuf = I3C_PID_MANUF_ID(devinfo.pid); > > > + u16 part = I3C_PID_PART_ID(devinfo.pid); > > > + u16 ext_info = I3C_PID_EXTRA_INFO(devinfo.pid); > > > + > > > + /* First try to match by manufacturer/part ID. */ > > > + for (id = id_table; id->match_flags != 0; id++) { > > > + if ((id->match_flags & I3C_MATCH_MANUF_AND_PART) != > > > + I3C_MATCH_MANUF_AND_PART) > > > + continue; > > > + > > > + if (manuf != id->manuf_id || part != id->part_id) > > > + continue; > > > + > > > + if ((id->match_flags & I3C_MATCH_EXTRA_INFO) && > > > + ext_info != id->extra_info) > > > + continue; > > > + > > > + return id; > > > + } > > > + } > > > + > > > + /* Fallback to DCR match. */ > > > + for (id = id_table; id->match_flags != 0; id++) { > > > + if ((id->match_flags & I3C_MATCH_DCR) && > > > + id->dcr == devinfo.dcr) > > > + return id; > > > + } > > > + > > > + return NULL; > > > +} > > > +EXPORT_SYMBOL_GPL(i3c_device_match_id); > > > + [1]https://www.kernel.org/doc/html/latest/driver-api/i3c/device-driver-api.html