From patchwork Mon Jan 19 02:25:15 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Klimov X-Patchwork-Id: 3077 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n0J2Kj29019668 for ; Sun, 18 Jan 2009 18:20:46 -0800 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756753AbZASCZK (ORCPT ); Sun, 18 Jan 2009 21:25:10 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756766AbZASCZK (ORCPT ); Sun, 18 Jan 2009 21:25:10 -0500 Received: from fg-out-1718.google.com ([72.14.220.159]:43337 "EHLO fg-out-1718.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756753AbZASCZI (ORCPT ); Sun, 18 Jan 2009 21:25:08 -0500 Received: by fg-out-1718.google.com with SMTP id 19so1207314fgg.17 for ; Sun, 18 Jan 2009 18:25:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:cc :in-reply-to:references:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; bh=fFW0xay52Lzv2mYhIoLH927hjzoWPBSU7C6wBWAPcMs=; b=sBI2DxmBVYHE7aqwterBG7A3gSIPCzC8sfCy+O2kzi+xMxFXB8uFf2WQvj+Ar/9IJi Uny9oiG2AArE0AmflrOheGoALdHGYNLvujpZ1cVP40iRBDSF7kDYPk4hB52guai6h3JW cDx/8l1VWqJlnyGolM9TGbHn068mSrNr7GHRk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; b=nWnonGMRINnrcoxkRruXy1iZjyH9ZmJfKBL01+U+WngMIkNy/XY+Tkx6y4ThMr/A4Q Ao/o+H+Ymg//PL0Jt9AP9XD9u/RXoxPUbJu4YGKhjZssNsADZ1hOGgs3i/khVaLIX/+4 6kIjtuOpBLxCdKUZlhK98UcnzPkkw4RRNCi2k= Received: by 10.86.95.8 with SMTP id s8mr1640741fgb.28.1232331906279; Sun, 18 Jan 2009 18:25:06 -0800 (PST) Received: from ?192.168.1.42? (gw.zunet.ru [217.67.117.64]) by mx.google.com with ESMTPS id e20sm566611fga.23.2009.01.18.18.25.05 (version=SSLv3 cipher=RC4-MD5); Sun, 18 Jan 2009 18:25:05 -0800 (PST) Subject: Re: [PULL] http://linuxtv.org/hg/~mcisely/pvrusb2 From: Alexey Klimov To: Mauro Carvalho Chehab Cc: Carsten Meier , Mike Isely , Thierry MERLE , Jean-Francois Moine , Laurent Pinchart , linux-media@vger.kernel.org In-Reply-To: <20090118233603.6725e5f1@caramujo.chehab.org> References: <20090115184133.724d1d70@tuvok> <20090116024750.2c10b433@pedra.chehab.org> <20090117190951.0ed3d776@tuvok> <20090118233603.6725e5f1@caramujo.chehab.org> Date: Mon, 19 Jan 2009 05:25:15 +0300 Message-Id: <1232331915.4762.5.camel@tux.localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.24.2 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org On Sun, 2009-01-18 at 23:36 -0200, Mauro Carvalho Chehab wrote: > On Sat, 17 Jan 2009 19:09:51 +0100 > Carsten Meier wrote: > > > Am Fri, 16 Jan 2009 02:47:50 -0200 > > schrieb Mauro Carvalho Chehab : > > > > > For usb devices, usb_make_path() provide a canonical name for the > > > device. For PCI ones, we have pci_name() for the same function. in > > > the case of pci devices, I suspect that all use pci_name(). We just > > > need to use usb_make_path() at the usb ones. > > > > > > > I looked at the sources for what string gets generated for bus_info by > > usb_make_path(). If it gets used by pvrusb2, my problems are solved, > > because it is constant across standby-wake-up-cycles. The pvrusb2's > > implementation currently delivers "usb 7-2 address 6" here. "address > > 6" corresponds to devnum which gets constantly increased, which results > > in always changing strings here. Sorry for my unneccessary complaints. > > Mike, Thierry, Jean-Francois, Laurent and others: > > IMO, we should patch all usb drivers to use usb_make_path(). It will be more > transparent to userspace, if all drivers provide the bus_info using the same > notation. Comments? I did this thing to dsbr100.c usb radio driver: And get such dmesg messages for different usb ports: usb-0000:00:1d.2-2 usb-0000:00:1d.0-1 Looks okay to my eyes or may be i missed something. Anyway it's more useful than just simple "USB" string. diff -r de513684aca2 linux/drivers/media/radio/dsbr100.c --- a/linux/drivers/media/radio/dsbr100.c Sun Jan 18 23:06:34 2009 -0200 +++ b/linux/drivers/media/radio/dsbr100.c Mon Jan 19 05:18:36 2009 +0300 @@ -393,9 +393,12 @@ static int vidioc_querycap(struct file *file, void *priv, struct v4l2_capability *v) { + struct dsbr100_device *radio = video_drvdata(file); + strlcpy(v->driver, "dsbr100", sizeof(v->driver)); strlcpy(v->card, "D-Link R-100 USB FM Radio", sizeof(v->card)); - sprintf(v->bus_info, "USB"); + usb_make_path(radio->usbdev, v->bus_info, sizeof(v->bus_info)); + printk(KERN_INFO "%s\n", v->bus_info); v->version = RADIO_VERSION; v->capabilities = V4L2_CAP_TUNER; return 0;