static int sock_timestamping_bind_phc(struct sock *sk, int phc_index)
{
	struct net *net = sock_net(sk);
	struct net_device *dev = NULL;
	bool match = false;
	int *vclock_index;
	int i, num;

	if (sk->sk_bound_dev_if)
		dev = dev_get_by_index(net, sk->sk_bound_dev_if);

	if (!dev) {
		pr_err("%s: sock not bind to device\n", __func__);
		return -EOPNOTSUPP;
	}

	num = ethtool_get_phc_vclocks(dev, &vclock_index);
	for (i = 0; i < num; i++) {
		if (*(vclock_index + i) == phc_index) {
			match = true;
			break;
		}
	}

	if (num > 0)
		kfree(vclock_index);

	if (!match)
		return -EINVAL;

	sk->sk_bind_phc = phc_index;

	return 0;
}
static int sock_timestamping_bind_phc(struct sock *sk, int phc_index)
{
	struct net *net = sock_net(sk);
	struct net_device *dev = NULL;
	bool match = false;
	int *vclock_index;
	int i, num;

	if (sk->sk_bound_dev_if)
		dev = dev_get_by_index(net, sk->sk_bound_dev_if);

	if (!dev) {
		pr_err("%s: sock not bind to device\n", __func__);
		return -EOPNOTSUPP;
	}

	num = ethtool_get_phc_vclocks(dev, &vclock_index);
	for (i = 0; i < num; i++) {
		if (*(vclock_index + i) == phc_index) {
			match = true;
			break;
		}
	}

	if (num > 0)
		kfree(vclock_index);

	if (!match)
		return -EINVAL;

	sk->sk_bind_phc = phc_index;

	return 0;
}