Find the answer to your Linux question:
Results 1 to 3 of 3
I have an embedded system and I have developed a device driver for a hard disk controller. When I insert the driver using insmod I get the following error. WARNING: ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2012
    Posts
    8

    device driver for hard disk


    I have an embedded system and I have developed a device driver for a hard disk controller. When I insert the driver using insmod I get the following error.

    WARNING: at fs/sysfs/dir.c:455 sysfs_add_one+0xb0/0xdc()
    sysfs: cannot create duplicate filename '/block/xsa'

    I understand that it is trying to use the name xsa which is already registered to a compact flash card. My question is how does the Kernel decide on the name that should be used?

    Thanks

    Jon

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,459
    Quote Originally Posted by beandigital View Post
    I have an embedded system and I have developed a device driver for a hard disk controller. When I insert the driver using insmod I get the following error.

    WARNING: at fs/sysfs/dir.c:455 sysfs_add_one+0xb0/0xdc()
    sysfs: cannot create duplicate filename '/block/xsa'

    I understand that it is trying to use the name xsa which is already registered to a compact flash card. My question is how does the Kernel decide on the name that should be used?

    Thanks

    Jon
    My guess is that you took your code from an existing driver instead of working from scratch. Search your driver code base for the name 'xsa'. My suspicion is that you need to change a macro value or constant variable or structure setting that defines this.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Jul 2012
    Posts
    8
    Quote Originally Posted by Rubberman View Post
    My guess is that you took your code from an existing driver instead of working from scratch. Search your driver code base for the name 'xsa'. My suspicion is that you need to change a macro value or constant variable or structure setting that defines this.
    Yes someone on another forum suggested something similar so I had a look at the code and found this

    snprintf(bean->gd->disk_name, 32, "xs%c", bean->id + 'a');

    I haven't had chance to test it but I would guess I need to change the "xs%c" to something like "sd%c". I did use another driver as a starting point.

    Thanks

    Jon

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •