/* caller is responsible for freeing */ static char *msenc_get_fw_name(struct platform_device *dev) { char *fw_name; u8 maj, min; struct nvhost_device_data *pdata = platform_get_drvdata(dev); /* note size here is a little over...*/ fw_name = kzalloc(32, GFP_KERNEL); if (!fw_name) return NULL; decode_msenc_ver(pdata->version, &maj, &min); switch (maj) { case 2: /* there are no minor versions so far for maj==2 */ sprintf(fw_name, "nvhost_msenc02.fw"); break; case 3: sprintf(fw_name, "nvhost_msenc03%d.fw", min); break; default: kfree(fw_name); return NULL; } dev_info(&dev->dev, "fw name:%s\n", fw_name); return fw_name; }
/* caller is responsible for freeing */ static char *msenc_get_fw_name(struct nvhost_device *dev) { char *fw_name; u8 maj, min; /*note size here is a little over...*/ fw_name = kzalloc(32, GFP_KERNEL); if (!fw_name) return NULL; decode_msenc_ver(dev->version, &maj, &min); if (maj == 2) { /* there are no minor versions so far for maj==2 */ sprintf(fw_name, "nvhost_msenc02.fw"); } else { kfree(fw_name); return NULL; } dev_info(&dev->dev, "fw name:%s\n", fw_name); return fw_name; }