kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: mmucciolo@suteba.org.ar (Matias Mucciolo)
To: kernelnewbies@lists.kernelnewbies.org
Subject: device_create_file() and device_remove_file()
Date: Wed, 14 Sep 2016 14:46:41 -0300	[thread overview]
Message-ID: <14888517.JpScWTqqRk@varitech> (raw)


Hi
im looking at the driver:
drivers/staging/olpc_dcon/olpc_dcon.c

(trying to clean up __ATTR with DEVICE_ATTR_RO/_RW)

line 663 creates sysfs files(in a for) :

......
rc = device_create_file(&dcon_device->dev, &dcon_device_files[i]);
if (rc) {
	dev_err(&dcon_device->dev, "Cannot create sysfs file\n");
	goto ecreate;
}
...

if it fails, then in the goto removes the created ones
with device_remove_file() and exits

the question i have is: 
if don't fails and the files are created ...
in that code i don't see any other device_remove_file() call
to remove the files when, for example, the module unload.

i thinking its because when its load and used by the device they can't
be unload ?? so they don't need to clean up those files ?
or i missing something ?

Thanks

-- 

Matias Mucciolo

Area de Infraestructura.
Piedras 737 C.A.B.A 
SUTEBA 

                 reply	other threads:[~2016-09-14 17:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=14888517.JpScWTqqRk@varitech \
    --to=mmucciolo@suteba.org.ar \
    --cc=kernelnewbies@lists.kernelnewbies.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;
as well as URLs for NNTP newsgroup(s).