hi all,
i have created a device file with only write
permission::
ssize_t add_target_store(struct device *dev, const
char *buf, size_t count)
{
int data;
struct vt_host_info * vthost;
vthost=to_vt_host_info(dev);
if(1!=sscanf(buf,"%d",&data))-->it goes inside
{
printk(KERN_ERR "Invalid Data Entered count ::%u::
%s",(unsigned int)count,buf);
return -EINVAL;
}
printk("Device target will be added\n");
return count;
}
DEVICE_ATTR(add_target, S_IWUSR , NULL,
add_target_store);
and created the file using ::
if((i=device_register(dev)))
return i;
device_create_file(dev ,&dev_attr_add_target);
but when i perform
echo 2 >sysfs file
it gives garbage
why is it so ??
thanks in advance
Yahoo! Mail
Bring photos to life! New PhotoMail makes sharing a breeze.