unsigned long gpio_regs_phys;
struct device *dev;
char dev_name[32];
+ char class_name[64];
int major;
};
struct device *dev = &pdev->dev;
struct resource *ioresource;
const char *str;
- char tmp[64];
struct aml_gpiomem_instance *inst = NULL;
/* Allocate buffers and instance data */
inst->dev_name[31] = '\0';
/* Create character device entries */
- sprintf(tmp, "aml-%s", inst->dev_name);
+ sprintf(inst->class_name, "aml-%s", inst->dev_name);
err = alloc_chrdev_region(&aml_gpiomem_devid,
- DEVICE_MINOR, 1, tmp);
+ DEVICE_MINOR, 1, inst->class_name);
if (err != 0) {
dev_err(inst->dev, "unable to allocate device number");
goto failed_alloc_chrdev;
}
/* Create sysfs entries */
- aml_gpiomem_class = class_create(THIS_MODULE, tmp);
+ aml_gpiomem_class = class_create(THIS_MODULE, inst->class_name);
ptr_err = aml_gpiomem_class;
if (IS_ERR(ptr_err))
goto failed_class_create;