Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/exynos/ipp: remove struct exynos_drm_ipp_private

struct exynos_drm_ipp_private contains only one pointer so all occurrences
of the struct can be replaced by the pointer itself.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>

authored by

Andrzej Hajda and committed by
Inki Dae
5c76c5b1 c51f73b3

+12 -28
+1 -5
drivers/gpu/drm/exynos/exynos_drm_drv.h
··· 237 237 struct list_head userptr_list; 238 238 }; 239 239 240 - struct exynos_drm_ipp_private { 241 - struct device *dev; 242 - }; 243 - 244 240 struct drm_exynos_file_private { 245 241 struct exynos_drm_g2d_private *g2d_priv; 246 - struct exynos_drm_ipp_private *ipp_priv; 242 + struct device *ipp_dev; 247 243 struct file *anon_filp; 248 244 }; 249 245
+9 -21
drivers/gpu/drm/exynos/exynos_drm_ipp.c
··· 308 308 struct drm_file *file) 309 309 { 310 310 struct drm_exynos_file_private *file_priv = file->driver_priv; 311 - struct exynos_drm_ipp_private *priv = file_priv->ipp_priv; 312 - struct device *dev = priv->dev; 311 + struct device *dev = file_priv->ipp_dev; 313 312 struct ipp_context *ctx = get_ipp_context(dev); 314 313 struct drm_exynos_ipp_prop_list *prop_list = data; 315 314 struct exynos_drm_ippdrv *ippdrv; ··· 440 441 struct drm_file *file) 441 442 { 442 443 struct drm_exynos_file_private *file_priv = file->driver_priv; 443 - struct exynos_drm_ipp_private *priv = file_priv->ipp_priv; 444 - struct device *dev = priv->dev; 444 + struct device *dev = file_priv->ipp_dev; 445 445 struct ipp_context *ctx = get_ipp_context(dev); 446 446 struct drm_exynos_ipp_property *property = data; 447 447 struct exynos_drm_ippdrv *ippdrv; ··· 499 501 property->prop_id, property->cmd, (int)ippdrv); 500 502 501 503 /* stored property information and ippdrv in private data */ 502 - c_node->priv = priv; 504 + c_node->dev = dev; 503 505 c_node->property = *property; 504 506 c_node->state = IPP_STATE_IDLE; 505 507 ··· 927 929 struct drm_file *file) 928 930 { 929 931 struct drm_exynos_file_private *file_priv = file->driver_priv; 930 - struct exynos_drm_ipp_private *priv = file_priv->ipp_priv; 931 - struct device *dev = priv->dev; 932 + struct device *dev = file_priv->ipp_dev; 932 933 struct ipp_context *ctx = get_ipp_context(dev); 933 934 struct drm_exynos_ipp_queue_buf *qbuf = data; 934 935 struct drm_exynos_ipp_cmd_node *c_node; ··· 1058 1061 struct drm_file *file) 1059 1062 { 1060 1063 struct drm_exynos_file_private *file_priv = file->driver_priv; 1061 - struct exynos_drm_ipp_private *priv = file_priv->ipp_priv; 1062 1064 struct exynos_drm_ippdrv *ippdrv = NULL; 1063 - struct device *dev = priv->dev; 1065 + struct device *dev = file_priv->ipp_dev; 1064 1066 struct ipp_context *ctx = get_ipp_context(dev); 1065 1067 struct drm_exynos_ipp_cmd_ctrl *cmd_ctrl = data; 1066 1068 struct drm_exynos_ipp_cmd_work *cmd_work; ··· 1771 1775 struct drm_file *file) 1772 1776 { 1773 1777 struct drm_exynos_file_private *file_priv = file->driver_priv; 1774 - struct exynos_drm_ipp_private *priv; 1775 1778 1776 - priv = kzalloc(sizeof(*priv), GFP_KERNEL); 1777 - if (!priv) 1778 - return -ENOMEM; 1779 - priv->dev = dev; 1780 - file_priv->ipp_priv = priv; 1779 + file_priv->ipp_dev = dev; 1781 1780 1782 - 1783 - DRM_DEBUG_KMS("done priv[0x%x]\n", (int)priv); 1781 + DRM_DEBUG_KMS("done priv[0x%x]\n", (int)dev); 1784 1782 1785 1783 return 0; 1786 1784 } ··· 1783 1793 struct drm_file *file) 1784 1794 { 1785 1795 struct drm_exynos_file_private *file_priv = file->driver_priv; 1786 - struct exynos_drm_ipp_private *priv = file_priv->ipp_priv; 1787 1796 struct exynos_drm_ippdrv *ippdrv = NULL; 1788 1797 struct ipp_context *ctx = get_ipp_context(dev); 1789 1798 struct drm_exynos_ipp_cmd_node *c_node, *tc_node; 1790 1799 int count = 0; 1791 1800 1792 - DRM_DEBUG_KMS("for priv[0x%x]\n", (int)priv); 1801 + DRM_DEBUG_KMS("for priv[0x%x]\n", (int)file_priv->ipp_dev); 1793 1802 1794 1803 list_for_each_entry(ippdrv, &exynos_drm_ippdrv_list, drv_list) { 1795 1804 mutex_lock(&ippdrv->cmd_lock); ··· 1797 1808 DRM_DEBUG_KMS("count[%d]ippdrv[0x%x]\n", 1798 1809 count++, (int)ippdrv); 1799 1810 1800 - if (c_node->priv == priv) { 1811 + if (c_node->dev == file_priv->ipp_dev) { 1801 1812 /* 1802 1813 * userland goto unnormal state. process killed. 1803 1814 * and close the file. ··· 1819 1830 mutex_unlock(&ippdrv->cmd_lock); 1820 1831 } 1821 1832 1822 - kfree(priv); 1823 1833 return; 1824 1834 } 1825 1835
+2 -2
drivers/gpu/drm/exynos/exynos_drm_ipp.h
··· 48 48 /* 49 49 * A structure of command node. 50 50 * 51 - * @priv: IPP private information. 51 + * @dev: IPP device. 52 52 * @list: list head to command queue information. 53 53 * @event_list: list head of event. 54 54 * @mem_list: list head to source,destination memory queue information. ··· 64 64 * @state: state of command node. 65 65 */ 66 66 struct drm_exynos_ipp_cmd_node { 67 - struct exynos_drm_ipp_private *priv; 67 + struct device *dev; 68 68 struct list_head list; 69 69 struct list_head event_list; 70 70 struct list_head mem_list[EXYNOS_DRM_OPS_MAX];