public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: sullivan <sullivan@austin.ibm.com>
To: Patrick Mochel <mochel@osdl.org>
Cc: linux-scsi@vger.kernel.org
Subject: Re: Removal of driverfs files in drivers/cdrom/cdrom.c
Date: Thu, 25 Jul 2002 08:36:49 -0500	[thread overview]
Message-ID: <20020725083649.D1757@austin.ibm.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0207241456570.954-100000@cherise.pdx.osdl.net>; from mochel@osdl.org on Wed, Jul 24, 2002 at 02:57:11PM -0700

On Wed, Jul 24, 2002 at 02:57:11PM -0700, Patrick Mochel wrote:
> 
> 
> So, I'm looking at changing the driverfs API. In doring so, I came across 
> this code in drivers/cdrom/cdrom.c:unregister_cdrom:
> 
>         if (atomic_read (&cdi->cdrom_driverfs_dev.refcount)) {
>                 device_remove_file (&cdi->cdrom_driverfs_dev, "name");
>                 device_remove_file (&cdi->cdrom_driverfs_dev, "kdev");
>                 put_device (&cdi->cdrom_driverfs_dev);
>         }
> 
> This looks wrong, based on the fact that it wasn't the cdrom layer that 
> created these files. They were, I believe, created by the SCSI cdrom 
> layer. So, why are they being removed here, esp. since they are removed at 
> a more general layer? 

Yes, I struggled with this one. I would prefer the implementation where the
lower layer (ie. scsi, ide) setup only the parent and bus fields of the
cdrom_driverfs_dev structure and let the more general layer (cdrom.c) do the
rest as part of the register_cdrom() call. Similarily, unregister_cdrom() would
do the removal.

Since there are a lot of drivers that register with the general cdrom layer 
that don't support driverfs yet, I didn't want to make changes across a whole
bunch of components needlessly until people got a chance to look at what the
device tree might look like for the scsi implementation. 

Maybe a first good step would be to move the cdrom support completely up into
the general layer and use the presence of a non NULL parent field to indicate
whether the lower level driver has added support for driverfs. We'd have to
make sure the cdrom_drverfs_dev structure is initialized with zeros for all of
the cdrom related driver layers that don't support driverfs yet. Let me know
what you think. I'll pull a patch together... 

> 
> Thanks,
> 
>         -pat
> 
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2002-07-25 13:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-24 21:57 Removal of driverfs files in drivers/cdrom/cdrom.c Patrick Mochel
2002-07-25 13:36 ` sullivan [this message]
2002-07-28 19:50   ` James Bottomley
2002-07-29 19:46     ` Patrick Mochel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020725083649.D1757@austin.ibm.com \
    --to=sullivan@austin.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mochel@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox