From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S263636AbTLSUh5 (ORCPT ); Fri, 19 Dec 2003 15:37:57 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S263620AbTLSUh5 (ORCPT ); Fri, 19 Dec 2003 15:37:57 -0500 Received: from linux.us.dell.com ([143.166.224.162]:2993 "EHLO lists.us.dell.com") by vger.kernel.org with ESMTP id S263609AbTLSUhx (ORCPT ); Fri, 19 Dec 2003 15:37:53 -0500 Date: Fri, 19 Dec 2003 14:37:49 -0600 From: Matt Domsch To: James Bottomley Cc: Linux Kernel , SCSI Mailing List Subject: Re: [RFC] 2.6.0 EDD enhancements Message-ID: <20031219143749.A8351@lists.us.dell.com> References: <20031219130129.B6530@lists.us.dell.com> <1071865401.1943.31.camel@mulgrave> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <1071865401.1943.31.camel@mulgrave>; from James.Bottomley@steeleye.com on Fri, Dec 19, 2003 at 03:23:21PM -0500 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org > This is a bit nasty...you're assuming a lot of hidden knowledge about > the layout of sysfs objects in scsi_device in this code. > > The current(*) way you should be doing this is to use scsi_device_get() > in your edd_match_scsi_dev() and do a scsi_device_put() after creating > the link...that should be hotplug robust. Ok, I'll gladly make that change, but I still need a handle on the sdev_gendev.kobj in order to make the symlink: > rc = sysfs_create_link(&edev->kobj, > &sdev->sdev_gendev.kobj, > "disc"); While there's an accessor function to_scsi_device() to go from the struct device to the struct scsi_device, there's not accessor to go from the scsi_device to the struct device, which would further abstract struct internals. Can I get such added to a SCSI header file? Something like: static inline struct device * sdev_to_gendev(struct scsi_device *sdev) { return &sdev->sdev_gendev; } Thanks, Matt -- Matt Domsch Sr. Software Engineer, Lead Engineer Dell Linux Solutions www.dell.com/linux Linux on Dell mailing lists @ http://lists.us.dell.com